diff --git a/src/ImageSharp.Drawing/Primitives/ShapePath.cs b/src/ImageSharp.Drawing/Primitives/ShapePath.cs index 7a8c9e895..a4fef66a6 100644 --- a/src/ImageSharp.Drawing/Primitives/ShapePath.cs +++ b/src/ImageSharp.Drawing/Primitives/ShapePath.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using SixLabors.ImageSharp.Processing.Drawing.Pens; +using SixLabors.ImageSharp.Processing; using SixLabors.Shapes; namespace SixLabors.ImageSharp.Primitives diff --git a/src/ImageSharp.Drawing/Processing/Drawing/Brushes/BrushApplicator.cs b/src/ImageSharp.Drawing/Processing/BrushApplicator.cs similarity index 98% rename from src/ImageSharp.Drawing/Processing/Drawing/Brushes/BrushApplicator.cs rename to src/ImageSharp.Drawing/Processing/BrushApplicator.cs index 7672681da..04e2d0b9d 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/Brushes/BrushApplicator.cs +++ b/src/ImageSharp.Drawing/Processing/BrushApplicator.cs @@ -6,7 +6,7 @@ using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; using SixLabors.Memory; -namespace SixLabors.ImageSharp.Processing.Drawing.Brushes +namespace SixLabors.ImageSharp.Processing { /// /// primitive that converts a point in to a color for discovering the fill color based on an implementation diff --git a/src/ImageSharp.Drawing/Processing/Drawing/Brushes/Brushes.cs b/src/ImageSharp.Drawing/Processing/Brushes.cs similarity index 99% rename from src/ImageSharp.Drawing/Processing/Drawing/Brushes/Brushes.cs rename to src/ImageSharp.Drawing/Processing/Brushes.cs index 141ca403b..c5e7a3e9f 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/Brushes/Brushes.cs +++ b/src/ImageSharp.Drawing/Processing/Brushes.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Drawing.Brushes +namespace SixLabors.ImageSharp.Processing { /// /// A collection of methods for creating generic brushes. diff --git a/src/ImageSharp.Drawing/Processing/Drawing/Brushes/GradientBrushes/ColorStop{TPixel}.cs b/src/ImageSharp.Drawing/Processing/ColorStop{TPixel}.cs similarity index 86% rename from src/ImageSharp.Drawing/Processing/Drawing/Brushes/GradientBrushes/ColorStop{TPixel}.cs rename to src/ImageSharp.Drawing/Processing/ColorStop{TPixel}.cs index 298af5cb5..7fd0ba7cd 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/Brushes/GradientBrushes/ColorStop{TPixel}.cs +++ b/src/ImageSharp.Drawing/Processing/ColorStop{TPixel}.cs @@ -1,8 +1,11 @@ -using System.Diagnostics; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using System.Diagnostics; using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Drawing.Brushes.GradientBrushes +namespace SixLabors.ImageSharp.Processing { /// /// A struct that defines a single color stop. diff --git a/src/ImageSharp.Drawing/Processing/Drawing/DrawBezierExtensions.cs b/src/ImageSharp.Drawing/Processing/DrawBezierExtensions.cs similarity index 97% rename from src/ImageSharp.Drawing/Processing/Drawing/DrawBezierExtensions.cs rename to src/ImageSharp.Drawing/Processing/DrawBezierExtensions.cs index 72bd76fa6..782f5d4d7 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/DrawBezierExtensions.cs +++ b/src/ImageSharp.Drawing/Processing/DrawBezierExtensions.cs @@ -2,12 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Drawing.Brushes; -using SixLabors.ImageSharp.Processing.Drawing.Pens; using SixLabors.Primitives; using SixLabors.Shapes; -namespace SixLabors.ImageSharp.Processing.Drawing +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the drawing of Bezier paths to the type. diff --git a/src/ImageSharp.Drawing/Processing/Drawing/DrawImageExtensions.cs b/src/ImageSharp.Drawing/Processing/DrawImageExtensions.cs similarity index 98% rename from src/ImageSharp.Drawing/Processing/Drawing/DrawImageExtensions.cs rename to src/ImageSharp.Drawing/Processing/DrawImageExtensions.cs index 83e1b90f5..7c9d7c280 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/DrawImageExtensions.cs +++ b/src/ImageSharp.Drawing/Processing/DrawImageExtensions.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Drawing.Processors; +using SixLabors.ImageSharp.Processing.Processors.Drawing; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Drawing +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the drawing of images to the type. diff --git a/src/ImageSharp.Drawing/Processing/Drawing/DrawLineExtensions.cs b/src/ImageSharp.Drawing/Processing/DrawLineExtensions.cs similarity index 97% rename from src/ImageSharp.Drawing/Processing/Drawing/DrawLineExtensions.cs rename to src/ImageSharp.Drawing/Processing/DrawLineExtensions.cs index 981a07e13..9084b30ef 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/DrawLineExtensions.cs +++ b/src/ImageSharp.Drawing/Processing/DrawLineExtensions.cs @@ -2,12 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Drawing.Brushes; -using SixLabors.ImageSharp.Processing.Drawing.Pens; using SixLabors.Primitives; using SixLabors.Shapes; -namespace SixLabors.ImageSharp.Processing.Drawing +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the drawing of lines to the type. diff --git a/src/ImageSharp.Drawing/Processing/Drawing/DrawPathCollectionExtensions.cs b/src/ImageSharp.Drawing/Processing/DrawPathCollectionExtensions.cs similarity index 97% rename from src/ImageSharp.Drawing/Processing/Drawing/DrawPathCollectionExtensions.cs rename to src/ImageSharp.Drawing/Processing/DrawPathCollectionExtensions.cs index eca3805bd..0d3abf297 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/DrawPathCollectionExtensions.cs +++ b/src/ImageSharp.Drawing/Processing/DrawPathCollectionExtensions.cs @@ -2,11 +2,9 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Drawing.Brushes; -using SixLabors.ImageSharp.Processing.Drawing.Pens; using SixLabors.Shapes; -namespace SixLabors.ImageSharp.Processing.Drawing +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the drawing of collections of polygon outlines to the type. diff --git a/src/ImageSharp.Drawing/Processing/Drawing/DrawPathExtensions.cs b/src/ImageSharp.Drawing/Processing/DrawPathExtensions.cs similarity index 97% rename from src/ImageSharp.Drawing/Processing/Drawing/DrawPathExtensions.cs rename to src/ImageSharp.Drawing/Processing/DrawPathExtensions.cs index a15412a45..4dbe942f2 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/DrawPathExtensions.cs +++ b/src/ImageSharp.Drawing/Processing/DrawPathExtensions.cs @@ -3,11 +3,9 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Primitives; -using SixLabors.ImageSharp.Processing.Drawing.Brushes; -using SixLabors.ImageSharp.Processing.Drawing.Pens; using SixLabors.Shapes; -namespace SixLabors.ImageSharp.Processing.Drawing +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the drawing of polygon outlines to the type. diff --git a/src/ImageSharp.Drawing/Processing/Drawing/DrawPolygonExtensions.cs b/src/ImageSharp.Drawing/Processing/DrawPolygonExtensions.cs similarity index 97% rename from src/ImageSharp.Drawing/Processing/Drawing/DrawPolygonExtensions.cs rename to src/ImageSharp.Drawing/Processing/DrawPolygonExtensions.cs index 9f8d74f00..4dcfe00aa 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/DrawPolygonExtensions.cs +++ b/src/ImageSharp.Drawing/Processing/DrawPolygonExtensions.cs @@ -2,12 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Drawing.Brushes; -using SixLabors.ImageSharp.Processing.Drawing.Pens; using SixLabors.Primitives; using SixLabors.Shapes; -namespace SixLabors.ImageSharp.Processing.Drawing +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the drawing of closed linear polygons to the type. diff --git a/src/ImageSharp.Drawing/Processing/Drawing/DrawRectangleExtensions.cs b/src/ImageSharp.Drawing/Processing/DrawRectangleExtensions.cs similarity index 97% rename from src/ImageSharp.Drawing/Processing/Drawing/DrawRectangleExtensions.cs rename to src/ImageSharp.Drawing/Processing/DrawRectangleExtensions.cs index 1f4a38a27..918fb1e73 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/DrawRectangleExtensions.cs +++ b/src/ImageSharp.Drawing/Processing/DrawRectangleExtensions.cs @@ -2,12 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Drawing.Brushes; -using SixLabors.ImageSharp.Processing.Drawing.Pens; using SixLabors.Primitives; using SixLabors.Shapes; -namespace SixLabors.ImageSharp.Processing.Drawing +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the drawing of rectangles to the type. diff --git a/src/ImageSharp.Drawing/Processing/Text/DrawTextExtensions.cs b/src/ImageSharp.Drawing/Processing/DrawTextExtensions.cs similarity index 96% rename from src/ImageSharp.Drawing/Processing/Text/DrawTextExtensions.cs rename to src/ImageSharp.Drawing/Processing/DrawTextExtensions.cs index a20d7f730..46061ce9b 100644 --- a/src/ImageSharp.Drawing/Processing/Text/DrawTextExtensions.cs +++ b/src/ImageSharp.Drawing/Processing/DrawTextExtensions.cs @@ -3,17 +3,15 @@ using SixLabors.Fonts; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Drawing.Brushes; -using SixLabors.ImageSharp.Processing.Drawing.Pens; -using SixLabors.ImageSharp.Processing.Text.Processors; +using SixLabors.ImageSharp.Processing.Processors.Text; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Text +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the drawing of text to the type. /// - public static partial class DrawTextExtensions + public static class DrawTextExtensions { /// /// Draws the text onto the the image filled via the brush. diff --git a/src/ImageSharp.Drawing/Processing/Drawing/Brushes/GradientBrushes/EllipticGradientBrush{TPixel}.cs b/src/ImageSharp.Drawing/Processing/EllipticGradientBrush{TPixel}.cs similarity index 97% rename from src/ImageSharp.Drawing/Processing/Drawing/Brushes/GradientBrushes/EllipticGradientBrush{TPixel}.cs rename to src/ImageSharp.Drawing/Processing/EllipticGradientBrush{TPixel}.cs index 43f7fe04e..8af01564c 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/Brushes/GradientBrushes/EllipticGradientBrush{TPixel}.cs +++ b/src/ImageSharp.Drawing/Processing/EllipticGradientBrush{TPixel}.cs @@ -1,9 +1,12 @@ -using System; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using System; using SixLabors.ImageSharp.PixelFormats; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Drawing.Brushes.GradientBrushes +namespace SixLabors.ImageSharp.Processing { /// /// Gradient Brush with elliptic shape. diff --git a/src/ImageSharp.Drawing/Processing/Drawing/FillPathBuilderExtensions.cs b/src/ImageSharp.Drawing/Processing/FillPathBuilderExtensions.cs similarity index 97% rename from src/ImageSharp.Drawing/Processing/Drawing/FillPathBuilderExtensions.cs rename to src/ImageSharp.Drawing/Processing/FillPathBuilderExtensions.cs index 921209d2e..ff4de3ff8 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/FillPathBuilderExtensions.cs +++ b/src/ImageSharp.Drawing/Processing/FillPathBuilderExtensions.cs @@ -3,10 +3,9 @@ using System; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Drawing.Brushes; using SixLabors.Shapes; -namespace SixLabors.ImageSharp.Processing.Drawing +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the filling of polygons with various brushes to the type. diff --git a/src/ImageSharp.Drawing/Processing/Drawing/FillPathCollectionExtensions.cs b/src/ImageSharp.Drawing/Processing/FillPathCollectionExtensions.cs similarity index 97% rename from src/ImageSharp.Drawing/Processing/Drawing/FillPathCollectionExtensions.cs rename to src/ImageSharp.Drawing/Processing/FillPathCollectionExtensions.cs index 71474dceb..da2dd35b6 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/FillPathCollectionExtensions.cs +++ b/src/ImageSharp.Drawing/Processing/FillPathCollectionExtensions.cs @@ -2,10 +2,9 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Drawing.Brushes; using SixLabors.Shapes; -namespace SixLabors.ImageSharp.Processing.Drawing +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the filling of collections of polygon outlines to the type. diff --git a/src/ImageSharp.Drawing/Processing/Drawing/FillPathExtensions.cs b/src/ImageSharp.Drawing/Processing/FillPathExtensions.cs similarity index 97% rename from src/ImageSharp.Drawing/Processing/Drawing/FillPathExtensions.cs rename to src/ImageSharp.Drawing/Processing/FillPathExtensions.cs index 4273fd8be..da1062111 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/FillPathExtensions.cs +++ b/src/ImageSharp.Drawing/Processing/FillPathExtensions.cs @@ -3,10 +3,9 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Primitives; -using SixLabors.ImageSharp.Processing.Drawing.Brushes; using SixLabors.Shapes; -namespace SixLabors.ImageSharp.Processing.Drawing +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the filling of polygon outlines to the type. diff --git a/src/ImageSharp.Drawing/Processing/Drawing/FillPolygonExtensions.cs b/src/ImageSharp.Drawing/Processing/FillPolygonExtensions.cs similarity index 97% rename from src/ImageSharp.Drawing/Processing/Drawing/FillPolygonExtensions.cs rename to src/ImageSharp.Drawing/Processing/FillPolygonExtensions.cs index 3b80dd0f4..970ca2264 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/FillPolygonExtensions.cs +++ b/src/ImageSharp.Drawing/Processing/FillPolygonExtensions.cs @@ -2,11 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Drawing.Brushes; using SixLabors.Primitives; using SixLabors.Shapes; -namespace SixLabors.ImageSharp.Processing.Drawing +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the filling of closed linear polygons to the type. diff --git a/src/ImageSharp.Drawing/Processing/Drawing/FillRectangleExtensions.cs b/src/ImageSharp.Drawing/Processing/FillRectangleExtensions.cs similarity index 97% rename from src/ImageSharp.Drawing/Processing/Drawing/FillRectangleExtensions.cs rename to src/ImageSharp.Drawing/Processing/FillRectangleExtensions.cs index ae0afc5d5..26bf214f7 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/FillRectangleExtensions.cs +++ b/src/ImageSharp.Drawing/Processing/FillRectangleExtensions.cs @@ -2,11 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Drawing.Brushes; using SixLabors.Primitives; using SixLabors.Shapes; -namespace SixLabors.ImageSharp.Processing.Drawing +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the filling of rectangles to the type. diff --git a/src/ImageSharp.Drawing/Processing/Drawing/FillRegionExtensions.cs b/src/ImageSharp.Drawing/Processing/FillRegionExtensions.cs similarity index 97% rename from src/ImageSharp.Drawing/Processing/Drawing/FillRegionExtensions.cs rename to src/ImageSharp.Drawing/Processing/FillRegionExtensions.cs index 997dba22e..e566d0323 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/FillRegionExtensions.cs +++ b/src/ImageSharp.Drawing/Processing/FillRegionExtensions.cs @@ -3,10 +3,9 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Primitives; -using SixLabors.ImageSharp.Processing.Drawing.Brushes; -using SixLabors.ImageSharp.Processing.Drawing.Processors; +using SixLabors.ImageSharp.Processing.Processors.Drawing; -namespace SixLabors.ImageSharp.Processing.Drawing +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the filling of regions with various brushes to the type. diff --git a/src/ImageSharp.Drawing/Processing/Drawing/Brushes/GradientBrushes/GradientBrushBase{TPixel}.cs b/src/ImageSharp.Drawing/Processing/GradientBrushBase{TPixel}.cs similarity index 97% rename from src/ImageSharp.Drawing/Processing/Drawing/Brushes/GradientBrushes/GradientBrushBase{TPixel}.cs rename to src/ImageSharp.Drawing/Processing/GradientBrushBase{TPixel}.cs index d0a1ef1c2..a844457ac 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/Brushes/GradientBrushes/GradientBrushBase{TPixel}.cs +++ b/src/ImageSharp.Drawing/Processing/GradientBrushBase{TPixel}.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.Numerics; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.PixelFormats.PixelBlenders; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Drawing.Brushes.GradientBrushes +namespace SixLabors.ImageSharp.Processing { /// /// Base class for Gradient brushes diff --git a/src/ImageSharp.Drawing/Processing/Drawing/Brushes/GradientBrushes/GradientRepetitionMode.cs b/src/ImageSharp.Drawing/Processing/GradientRepetitionMode.cs similarity index 89% rename from src/ImageSharp.Drawing/Processing/Drawing/Brushes/GradientBrushes/GradientRepetitionMode.cs rename to src/ImageSharp.Drawing/Processing/GradientRepetitionMode.cs index adbc26ed4..c156153be 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/Brushes/GradientBrushes/GradientRepetitionMode.cs +++ b/src/ImageSharp.Drawing/Processing/GradientRepetitionMode.cs @@ -1,4 +1,7 @@ -namespace SixLabors.ImageSharp.Processing.Drawing.Brushes.GradientBrushes +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +namespace SixLabors.ImageSharp.Processing { /// /// Modes to repeat a gradient. diff --git a/src/ImageSharp.Drawing/Processing/Drawing/Brushes/IBrush.cs b/src/ImageSharp.Drawing/Processing/IBrush.cs similarity index 96% rename from src/ImageSharp.Drawing/Processing/Drawing/Brushes/IBrush.cs rename to src/ImageSharp.Drawing/Processing/IBrush.cs index 93ecb7788..a3c94a1b5 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/Brushes/IBrush.cs +++ b/src/ImageSharp.Drawing/Processing/IBrush.cs @@ -4,7 +4,7 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Drawing.Brushes +namespace SixLabors.ImageSharp.Processing { /// /// Brush represents a logical configuration of a brush which can be used to source pixel colors diff --git a/src/ImageSharp.Drawing/Processing/Drawing/Pens/IPen.cs b/src/ImageSharp.Drawing/Processing/IPen.cs similarity index 89% rename from src/ImageSharp.Drawing/Processing/Drawing/Pens/IPen.cs rename to src/ImageSharp.Drawing/Processing/IPen.cs index 387165e20..6f63dcfd0 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/Pens/IPen.cs +++ b/src/ImageSharp.Drawing/Processing/IPen.cs @@ -3,9 +3,8 @@ using System; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Drawing.Brushes; -namespace SixLabors.ImageSharp.Processing.Drawing.Pens +namespace SixLabors.ImageSharp.Processing { /// /// Interface representing a Pen diff --git a/src/ImageSharp.Drawing/Processing/Drawing/Brushes/ImageBrush{TPixel}.cs b/src/ImageSharp.Drawing/Processing/ImageBrush{TPixel}.cs similarity index 98% rename from src/ImageSharp.Drawing/Processing/Drawing/Brushes/ImageBrush{TPixel}.cs rename to src/ImageSharp.Drawing/Processing/ImageBrush{TPixel}.cs index 779848856..7e24dbbe2 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/Brushes/ImageBrush{TPixel}.cs +++ b/src/ImageSharp.Drawing/Processing/ImageBrush{TPixel}.cs @@ -7,7 +7,7 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.Memory; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Drawing.Brushes +namespace SixLabors.ImageSharp.Processing { /// /// Provides an implementation of an image brush for painting images within areas. diff --git a/src/ImageSharp.Drawing/Processing/Drawing/Brushes/GradientBrushes/LinearGradientBrush{TPixel}.cs b/src/ImageSharp.Drawing/Processing/LinearGradientBrush{TPixel}.cs similarity index 97% rename from src/ImageSharp.Drawing/Processing/Drawing/Brushes/GradientBrushes/LinearGradientBrush{TPixel}.cs rename to src/ImageSharp.Drawing/Processing/LinearGradientBrush{TPixel}.cs index 09f816dd9..765bf5499 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/Brushes/GradientBrushes/LinearGradientBrush{TPixel}.cs +++ b/src/ImageSharp.Drawing/Processing/LinearGradientBrush{TPixel}.cs @@ -1,9 +1,12 @@ -using System; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using System; using SixLabors.ImageSharp.PixelFormats; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Drawing.Brushes.GradientBrushes +namespace SixLabors.ImageSharp.Processing { /// /// Provides an implementation of a brush for painting linear gradients within areas. diff --git a/src/ImageSharp.Drawing/Processing/Drawing/Brushes/PatternBrush{TPixel}.cs b/src/ImageSharp.Drawing/Processing/PatternBrush{TPixel}.cs similarity index 99% rename from src/ImageSharp.Drawing/Processing/Drawing/Brushes/PatternBrush{TPixel}.cs rename to src/ImageSharp.Drawing/Processing/PatternBrush{TPixel}.cs index 21f2066fb..30d78bc83 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/Brushes/PatternBrush{TPixel}.cs +++ b/src/ImageSharp.Drawing/Processing/PatternBrush{TPixel}.cs @@ -9,7 +9,7 @@ using SixLabors.ImageSharp.Primitives; using SixLabors.Memory; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Drawing.Brushes +namespace SixLabors.ImageSharp.Processing { /// /// Provides an implementation of a pattern brush for painting patterns. diff --git a/src/ImageSharp.Drawing/Processing/Drawing/Pens/Pens.cs b/src/ImageSharp.Drawing/Processing/Pens.cs similarity index 98% rename from src/ImageSharp.Drawing/Processing/Drawing/Pens/Pens.cs rename to src/ImageSharp.Drawing/Processing/Pens.cs index b1883e322..90253a3cb 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/Pens/Pens.cs +++ b/src/ImageSharp.Drawing/Processing/Pens.cs @@ -2,9 +2,8 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Drawing.Brushes; -namespace SixLabors.ImageSharp.Processing.Drawing.Pens +namespace SixLabors.ImageSharp.Processing { /// /// Contains a collection of common Pen styles diff --git a/src/ImageSharp.Drawing/Processing/Drawing/Pens/Pen{TPixel}.cs b/src/ImageSharp.Drawing/Processing/Pen{TPixel}.cs similarity index 84% rename from src/ImageSharp.Drawing/Processing/Drawing/Pens/Pen{TPixel}.cs rename to src/ImageSharp.Drawing/Processing/Pen{TPixel}.cs index 1dd6b6616..26c21a0e5 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/Pens/Pen{TPixel}.cs +++ b/src/ImageSharp.Drawing/Processing/Pen{TPixel}.cs @@ -3,9 +3,8 @@ using System; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Drawing.Brushes; -namespace SixLabors.ImageSharp.Processing.Drawing.Pens +namespace SixLabors.ImageSharp.Processing { /// /// Provides a pen that can apply a pattern to a line with a set brush and thickness @@ -25,7 +24,7 @@ namespace SixLabors.ImageSharp.Processing.Drawing.Pens private readonly float[] pattern; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The color. /// The width. @@ -36,7 +35,7 @@ namespace SixLabors.ImageSharp.Processing.Drawing.Pens } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The brush. /// The width. @@ -49,7 +48,7 @@ namespace SixLabors.ImageSharp.Processing.Drawing.Pens } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The color. /// The width. @@ -59,7 +58,7 @@ namespace SixLabors.ImageSharp.Processing.Drawing.Pens } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The brush. /// The width. diff --git a/src/ImageSharp.Drawing/Processing/Drawing/Processors/DrawImageProcessor.cs b/src/ImageSharp.Drawing/Processing/Processors/Drawing/DrawImageProcessor.cs similarity index 98% rename from src/ImageSharp.Drawing/Processing/Drawing/Processors/DrawImageProcessor.cs rename to src/ImageSharp.Drawing/Processing/Processors/Drawing/DrawImageProcessor.cs index 506df3886..e4b2eadb4 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/Processors/DrawImageProcessor.cs +++ b/src/ImageSharp.Drawing/Processing/Processors/Drawing/DrawImageProcessor.cs @@ -5,11 +5,10 @@ using System; using System.Threading.Tasks; using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Processors; using SixLabors.Memory; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Drawing.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Drawing { /// /// Combines two images together by blending the pixels. diff --git a/src/ImageSharp.Drawing/Processing/Drawing/Processors/FillProcessor.cs b/src/ImageSharp.Drawing/Processing/Processors/Drawing/FillProcessor.cs similarity index 96% rename from src/ImageSharp.Drawing/Processing/Drawing/Processors/FillProcessor.cs rename to src/ImageSharp.Drawing/Processing/Processors/Drawing/FillProcessor.cs index 4214041a7..595c94687 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/Processors/FillProcessor.cs +++ b/src/ImageSharp.Drawing/Processing/Processors/Drawing/FillProcessor.cs @@ -5,12 +5,11 @@ using System; using System.Threading.Tasks; using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Drawing.Brushes; -using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.ImageSharp.Processing; using SixLabors.Memory; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Drawing.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Drawing { /// /// Using the brush as a source of pixels colors blends the brush color with source. diff --git a/src/ImageSharp.Drawing/Processing/Drawing/Processors/FillRegionProcessor.cs b/src/ImageSharp.Drawing/Processing/Processors/Drawing/FillRegionProcessor.cs similarity index 97% rename from src/ImageSharp.Drawing/Processing/Drawing/Processors/FillRegionProcessor.cs rename to src/ImageSharp.Drawing/Processing/Processors/Drawing/FillRegionProcessor.cs index 1e968b97e..1cc954dd9 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/Processors/FillRegionProcessor.cs +++ b/src/ImageSharp.Drawing/Processing/Processors/Drawing/FillRegionProcessor.cs @@ -4,13 +4,11 @@ using System; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Primitives; -using SixLabors.ImageSharp.Processing.Drawing.Brushes; -using SixLabors.ImageSharp.Processing.Processors; using SixLabors.ImageSharp.Utils; using SixLabors.Memory; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Drawing.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Drawing { /// /// Using a brush and a shape fills shape with contents of brush the diff --git a/src/ImageSharp.Drawing/Processing/Text/Processors/DrawTextProcessor.cs b/src/ImageSharp.Drawing/Processing/Processors/Text/DrawTextProcessor.cs similarity index 98% rename from src/ImageSharp.Drawing/Processing/Text/Processors/DrawTextProcessor.cs rename to src/ImageSharp.Drawing/Processing/Processors/Text/DrawTextProcessor.cs index 9327f9449..9f1158154 100644 --- a/src/ImageSharp.Drawing/Processing/Text/Processors/DrawTextProcessor.cs +++ b/src/ImageSharp.Drawing/Processing/Processors/Text/DrawTextProcessor.cs @@ -6,15 +6,12 @@ using System.Collections.Generic; using SixLabors.Fonts; using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Drawing.Brushes; -using SixLabors.ImageSharp.Processing.Drawing.Pens; -using SixLabors.ImageSharp.Processing.Processors; using SixLabors.ImageSharp.Utils; using SixLabors.Memory; using SixLabors.Primitives; using SixLabors.Shapes; -namespace SixLabors.ImageSharp.Processing.Text.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Text { /// /// Using the brush as a source of pixels colors blends the brush color with source. diff --git a/src/ImageSharp.Drawing/Processing/Drawing/Brushes/GradientBrushes/RadialGradientBrush{TPixel}.cs b/src/ImageSharp.Drawing/Processing/RadialGradientBrush{TPixel}.cs similarity index 96% rename from src/ImageSharp.Drawing/Processing/Drawing/Brushes/GradientBrushes/RadialGradientBrush{TPixel}.cs rename to src/ImageSharp.Drawing/Processing/RadialGradientBrush{TPixel}.cs index 5c0d8051c..16380fc34 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/Brushes/GradientBrushes/RadialGradientBrush{TPixel}.cs +++ b/src/ImageSharp.Drawing/Processing/RadialGradientBrush{TPixel}.cs @@ -1,9 +1,12 @@ -using System; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using System; using SixLabors.ImageSharp.PixelFormats; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Drawing.Brushes.GradientBrushes +namespace SixLabors.ImageSharp.Processing { /// /// A Circular Gradient Brush, defined by center point and radius. diff --git a/src/ImageSharp.Drawing/Processing/Drawing/Brushes/RecolorBrush{TPixel}.cs b/src/ImageSharp.Drawing/Processing/RecolorBrush{TPixel}.cs similarity index 98% rename from src/ImageSharp.Drawing/Processing/Drawing/Brushes/RecolorBrush{TPixel}.cs rename to src/ImageSharp.Drawing/Processing/RecolorBrush{TPixel}.cs index a7da2cc5b..058b03d62 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/Brushes/RecolorBrush{TPixel}.cs +++ b/src/ImageSharp.Drawing/Processing/RecolorBrush{TPixel}.cs @@ -8,14 +8,14 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.Memory; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Drawing.Brushes +namespace SixLabors.ImageSharp.Processing { /// /// Provides an implementation of a brush that can recolor an image /// /// The pixel format. public class RecolorBrush : IBrush - where TPixel : struct, IPixel + where TPixel : struct, IPixel { /// /// Initializes a new instance of the class. diff --git a/src/ImageSharp.Drawing/Processing/Drawing/Brushes/SolidBrush{TPixel}.cs b/src/ImageSharp.Drawing/Processing/SolidBrush{TPixel}.cs similarity index 98% rename from src/ImageSharp.Drawing/Processing/Drawing/Brushes/SolidBrush{TPixel}.cs rename to src/ImageSharp.Drawing/Processing/SolidBrush{TPixel}.cs index 791c307bf..8a2d47c6c 100644 --- a/src/ImageSharp.Drawing/Processing/Drawing/Brushes/SolidBrush{TPixel}.cs +++ b/src/ImageSharp.Drawing/Processing/SolidBrush{TPixel}.cs @@ -7,7 +7,7 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.Memory; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Drawing.Brushes +namespace SixLabors.ImageSharp.Processing { /// /// Provides an implementation of a solid brush for painting solid color areas. diff --git a/src/ImageSharp.Drawing/Processing/Text/TextGraphicsOptions.cs b/src/ImageSharp.Drawing/Processing/TextGraphicsOptions.cs similarity index 99% rename from src/ImageSharp.Drawing/Processing/Text/TextGraphicsOptions.cs rename to src/ImageSharp.Drawing/Processing/TextGraphicsOptions.cs index aaa6dea56..dfad06768 100644 --- a/src/ImageSharp.Drawing/Processing/Text/TextGraphicsOptions.cs +++ b/src/ImageSharp.Drawing/Processing/TextGraphicsOptions.cs @@ -4,7 +4,7 @@ using SixLabors.Fonts; using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Text +namespace SixLabors.ImageSharp.Processing { /// /// Options for influencing the drawing functions. diff --git a/src/ImageSharp/Common/Helpers/InliningOptions.cs b/src/ImageSharp/Common/Helpers/InliningOptions.cs new file mode 100644 index 000000000..e1d51da8d --- /dev/null +++ b/src/ImageSharp/Common/Helpers/InliningOptions.cs @@ -0,0 +1,22 @@ +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +// Uncomment this for verbose profiler results: +// #define PROFILING +using System.Runtime.CompilerServices; + +namespace SixLabors.ImageSharp +{ + /// + /// Global inlining options. Helps temporarily disable inling for better profiler output. + /// + internal static class InliningOptions + { +#if PROFILING + public const MethodImplOptions ShortMethod = 0; +#else + public const MethodImplOptions ShortMethod = MethodImplOptions.AggressiveInlining; +#endif + public const MethodImplOptions ColdPath = MethodImplOptions.NoInlining; + } +} \ No newline at end of file diff --git a/src/ImageSharp/Formats/Gif/GifEncoder.cs b/src/ImageSharp/Formats/Gif/GifEncoder.cs index 07a70ad96..e8e28ccdd 100644 --- a/src/ImageSharp/Formats/Gif/GifEncoder.cs +++ b/src/ImageSharp/Formats/Gif/GifEncoder.cs @@ -5,7 +5,7 @@ using System.IO; using System.Text; using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Quantization; +using SixLabors.ImageSharp.Processing.Processors.Quantization; namespace SixLabors.ImageSharp.Formats.Gif { diff --git a/src/ImageSharp/Formats/Gif/GifEncoderCore.cs b/src/ImageSharp/Formats/Gif/GifEncoderCore.cs index 8a6415c3b..e4737f3bc 100644 --- a/src/ImageSharp/Formats/Gif/GifEncoderCore.cs +++ b/src/ImageSharp/Formats/Gif/GifEncoderCore.cs @@ -9,7 +9,7 @@ using System.Runtime.InteropServices; using System.Text; using SixLabors.ImageSharp.MetaData; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Quantization; +using SixLabors.ImageSharp.Processing.Processors.Quantization; using SixLabors.Memory; namespace SixLabors.ImageSharp.Formats.Gif diff --git a/src/ImageSharp/Formats/Gif/IGifEncoderOptions.cs b/src/ImageSharp/Formats/Gif/IGifEncoderOptions.cs index 30e476e7e..bad6e0031 100644 --- a/src/ImageSharp/Formats/Gif/IGifEncoderOptions.cs +++ b/src/ImageSharp/Formats/Gif/IGifEncoderOptions.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. using System.Text; -using SixLabors.ImageSharp.Processing.Quantization; +using SixLabors.ImageSharp.Processing.Processors.Quantization; namespace SixLabors.ImageSharp.Formats.Gif { diff --git a/src/ImageSharp/Formats/Jpeg/JpegThrowHelper.cs b/src/ImageSharp/Formats/Jpeg/JpegThrowHelper.cs new file mode 100644 index 000000000..c7f366660 --- /dev/null +++ b/src/ImageSharp/Formats/Jpeg/JpegThrowHelper.cs @@ -0,0 +1,26 @@ +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using System.Runtime.CompilerServices; + +namespace SixLabors.ImageSharp.Formats.Jpeg +{ + internal static class JpegThrowHelper + { + /// + /// Cold path optimization for throwing -s + /// + /// The error message for the exception + [MethodImpl(MethodImplOptions.NoInlining)] + public static void ThrowImageFormatException(string errorMessage) + { + throw new ImageFormatException(errorMessage); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static void ThrowBadHuffmanCode() + { + throw new ImageFormatException("Bad Huffman code."); + } + } +} \ No newline at end of file diff --git a/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/FastACTables.cs b/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/FastACTables.cs new file mode 100644 index 000000000..6cb0d6dfe --- /dev/null +++ b/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/FastACTables.cs @@ -0,0 +1,96 @@ +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using System; +using System.Runtime.CompilerServices; +using SixLabors.Memory; + +namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort.Components +{ + /// + /// The collection of lookup tables used for fast AC entropy scan decoding. + /// + internal sealed class FastACTables : IDisposable + { + private Buffer2D tables; + + /// + /// Initializes a new instance of the class. + /// + /// The memory allocator used to allocate memory for image processing operations. + public FastACTables(MemoryAllocator memoryAllocator) + { + this.tables = memoryAllocator.AllocateClean2D(512, 4); + } + + /// + /// Gets the representing the table at the index in the collection. + /// + /// The table index. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public ReadOnlySpan GetTableSpan(int index) + { + return this.tables.GetRowSpan(index); + } + + /// + /// Gets a reference to the first element of the AC table indexed by + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public ref short GetAcTableReference(PdfJsFrameComponent component) + { + return ref this.tables.GetRowSpan(component.ACHuffmanTableId)[0]; + } + + /// + /// Builds a lookup table for fast AC entropy scan decoding. + /// + /// The table index. + /// The collection of AC Huffman tables. + public void BuildACTableLut(int index, PdfJsHuffmanTables acHuffmanTables) + { + const int FastBits = ScanDecoder.FastBits; + Span fastAC = this.tables.GetRowSpan(index); + ref PdfJsHuffmanTable huffman = ref acHuffmanTables[index]; + + int i; + for (i = 0; i < (1 << FastBits); i++) + { + byte fast = huffman.Lookahead[i]; + fastAC[i] = 0; + if (fast < byte.MaxValue) + { + int rs = huffman.Values[fast]; + int run = (rs >> 4) & 15; + int magbits = rs & 15; + int len = huffman.Sizes[fast]; + + if (magbits > 0 && len + magbits <= FastBits) + { + // Magnitude code followed by receive_extend code + int k = ((i << len) & ((1 << FastBits) - 1)) >> (FastBits - magbits); + int m = 1 << (magbits - 1); + if (k < m) + { + k += (int)((~0U << magbits) + 1); + } + + // if the result is small enough, we can fit it in fastAC table + if (k >= -128 && k <= 127) + { + fastAC[i] = (short)((k * 256) + (run * 16) + (len + magbits)); + } + } + } + } + } + + /// + public void Dispose() + { + this.tables?.Dispose(); + this.tables = null; + } + } +} \ No newline at end of file diff --git a/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/FixedByteBuffer512.cs b/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/FixedByteBuffer512.cs new file mode 100644 index 000000000..c509903c9 --- /dev/null +++ b/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/FixedByteBuffer512.cs @@ -0,0 +1,24 @@ +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort.Components +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct FixedByteBuffer512 + { + public fixed byte Data[1 << ScanDecoder.FastBits]; + + public byte this[int idx] + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + ref byte self = ref Unsafe.As(ref this); + return Unsafe.Add(ref self, idx); + } + } + } +} \ No newline at end of file diff --git a/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/FixedInt16Buffer256.cs b/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/FixedInt16Buffer257.cs similarity index 84% rename from src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/FixedInt16Buffer256.cs rename to src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/FixedInt16Buffer257.cs index 2c16a918f..b304dbf8c 100644 --- a/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/FixedInt16Buffer256.cs +++ b/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/FixedInt16Buffer257.cs @@ -7,16 +7,16 @@ using System.Runtime.InteropServices; namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort.Components { [StructLayout(LayoutKind.Sequential)] - internal unsafe struct FixedInt16Buffer256 + internal unsafe struct FixedInt16Buffer257 { - public fixed short Data[256]; + public fixed short Data[257]; public short this[int idx] { [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - ref short self = ref Unsafe.As(ref this); + ref short self = ref Unsafe.As(ref this); return Unsafe.Add(ref self, idx); } } diff --git a/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/FixedInt64Buffer18.cs b/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/FixedInt32Buffer18.cs similarity index 70% rename from src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/FixedInt64Buffer18.cs rename to src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/FixedInt32Buffer18.cs index 51381cb27..f8507ec47 100644 --- a/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/FixedInt64Buffer18.cs +++ b/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/FixedInt32Buffer18.cs @@ -7,16 +7,16 @@ using System.Runtime.InteropServices; namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort.Components { [StructLayout(LayoutKind.Sequential)] - internal unsafe struct FixedInt64Buffer18 + internal unsafe struct FixedInt32Buffer18 { - public fixed long Data[18]; + public fixed int Data[18]; - public long this[int idx] + public int this[int idx] { [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - ref long self = ref Unsafe.As(ref this); + ref int self = ref Unsafe.As(ref this); return Unsafe.Add(ref self, idx); } } diff --git a/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/FixedInt16Buffer18.cs b/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/FixedUInt32Buffer18.cs similarity index 70% rename from src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/FixedInt16Buffer18.cs rename to src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/FixedUInt32Buffer18.cs index 20d4b7733..9b076d9da 100644 --- a/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/FixedInt16Buffer18.cs +++ b/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/FixedUInt32Buffer18.cs @@ -7,16 +7,16 @@ using System.Runtime.InteropServices; namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort.Components { [StructLayout(LayoutKind.Sequential)] - internal unsafe struct FixedInt16Buffer18 + internal unsafe struct FixedUInt32Buffer18 { - public fixed short Data[18]; + public fixed uint Data[18]; - public short this[int idx] + public uint this[int idx] { [MethodImpl(MethodImplOptions.AggressiveInlining)] get { - ref short self = ref Unsafe.As(ref this); + ref uint self = ref Unsafe.As(ref this); return Unsafe.Add(ref self, idx); } } diff --git a/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/PdfJsFrameComponent.cs b/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/PdfJsFrameComponent.cs index eefe8b97e..7501b0d83 100644 --- a/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/PdfJsFrameComponent.cs +++ b/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/PdfJsFrameComponent.cs @@ -129,7 +129,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort.Components this.SubSamplingDivisors = c0.SamplingFactors.DivideBy(this.SamplingFactors); } - this.SpectralBlocks = this.memoryAllocator.Allocate2D(blocksPerColumnForMcu, blocksPerLineForMcu + 1, true); + this.SpectralBlocks = this.memoryAllocator.AllocateClean2D(blocksPerColumnForMcu, blocksPerLineForMcu + 1); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -144,5 +144,13 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort.Components { return 64 * (((this.WidthInBlocks + 1) * row) + col); } + + // TODO: we need consistence in (row, col) VS (col, row) ordering + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public ref short GetBlockDataReference(int row, int col) + { + ref Block8x8 blockRef = ref this.GetBlockReference(col, row); + return ref Unsafe.As(ref blockRef); + } } } \ No newline at end of file diff --git a/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/PdfJsHuffmanTable.cs b/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/PdfJsHuffmanTable.cs index 2789f0cc0..15ae56331 100644 --- a/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/PdfJsHuffmanTable.cs +++ b/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/PdfJsHuffmanTable.cs @@ -17,163 +17,114 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort.Components /// /// Gets the max code array /// - public FixedInt64Buffer18 MaxCode; + public FixedUInt32Buffer18 MaxCode; /// /// Gets the value offset array /// - public FixedInt16Buffer18 ValOffset; + public FixedInt32Buffer18 ValOffset; /// /// Gets the huffman value array /// - public FixedByteBuffer256 HuffVal; + public FixedByteBuffer256 Values; /// /// Gets the lookahead array /// - public FixedInt16Buffer256 Lookahead; + public FixedByteBuffer512 Lookahead; + + /// + /// Gets the sizes array + /// + public FixedInt16Buffer257 Sizes; /// /// Initializes a new instance of the struct. /// /// The to use for buffer allocations. - /// The code lengths + /// The code lengths /// The huffman values - public PdfJsHuffmanTable(MemoryAllocator memoryAllocator, ReadOnlySpan lengths, ReadOnlySpan values) + public PdfJsHuffmanTable(MemoryAllocator memoryAllocator, ReadOnlySpan count, ReadOnlySpan values) { - const int length = 257; - using (IBuffer huffsize = memoryAllocator.Allocate(length)) - using (IBuffer huffcode = memoryAllocator.Allocate(length)) + const int Length = 257; + using (IBuffer huffcode = memoryAllocator.Allocate(Length)) { - ref short huffsizeRef = ref MemoryMarshal.GetReference(huffsize.GetSpan()); ref short huffcodeRef = ref MemoryMarshal.GetReference(huffcode.GetSpan()); - GenerateSizeTable(lengths, ref huffsizeRef); - GenerateCodeTable(ref huffsizeRef, ref huffcodeRef, length); - this.GenerateDecoderTables(lengths, ref huffcodeRef); - this.GenerateLookaheadTables(lengths, values, ref huffcodeRef); - } - - fixed (byte* huffValRef = this.HuffVal.Data) - { - var huffValSpan = new Span(huffValRef, 256); - - values.CopyTo(huffValSpan); - } - } - - /// - /// Figure C.1: make table of Huffman code length for each symbol - /// - /// The code lengths - /// The huffman size span ref - private static void GenerateSizeTable(ReadOnlySpan lengths, ref short huffsizeRef) - { - short index = 0; - for (short l = 1; l <= 16; l++) - { - byte i = lengths[l]; - for (short j = 0; j < i; j++) - { - Unsafe.Add(ref huffsizeRef, index) = l; - index++; - } - } - - Unsafe.Add(ref huffsizeRef, index) = 0; - } - - /// - /// Figure C.2: generate the codes themselves - /// - /// The huffman size span ref - /// The huffman code span ref - /// The length of the huffsize span - private static void GenerateCodeTable(ref short huffsizeRef, ref short huffcodeRef, int length) - { - short k = 0; - short si = huffsizeRef; - short code = 0; - for (short i = 0; i < length; i++) - { - while (Unsafe.Add(ref huffsizeRef, k) == si) - { - Unsafe.Add(ref huffcodeRef, k) = code; - code++; - k++; - } - - code <<= 1; - si++; - } - } - - /// - /// Figure F.15: generate decoding tables for bit-sequential decoding - /// - /// The code lengths - /// The huffman code span ref - private void GenerateDecoderTables(ReadOnlySpan lengths, ref short huffcodeRef) - { - fixed (short* valOffsetRef = this.ValOffset.Data) - fixed (long* maxcodeRef = this.MaxCode.Data) - { - short bitcount = 0; - for (int i = 1; i <= 16; i++) + // Figure C.1: make table of Huffman code length for each symbol + fixed (short* sizesRef = this.Sizes.Data) { - if (lengths[i] != 0) + short x = 0; + for (short i = 1; i < 17; i++) { - // valOffsetRef[l] = huffcodeRef[] index of 1st symbol of code length i, minus the minimum code of length i - valOffsetRef[i] = (short)(bitcount - Unsafe.Add(ref huffcodeRef, bitcount)); - bitcount += lengths[i]; - maxcodeRef[i] = Unsafe.Add(ref huffcodeRef, bitcount - 1); // maximum code of length i - } - else - { - maxcodeRef[i] = -1; // -1 if no codes of this length + byte l = count[i]; + for (short j = 0; j < l; j++) + { + sizesRef[x] = i; + x++; + } } - } - valOffsetRef[17] = 0; - maxcodeRef[17] = 0xFFFFFL; - } - } + sizesRef[x] = 0; - /// - /// Generates lookup tables to speed up decoding - /// - /// The code lengths - /// The huffman value array - /// The huffman code span ref - private void GenerateLookaheadTables(ReadOnlySpan lengths, ReadOnlySpan huffval, ref short huffcodeRef) - { - // TODO: This generation code matches the libJpeg code but the lookahead table is not actually used yet. - // To use it we need to implement fast lookup path in PdfJsScanDecoder.DecodeHuffman - // This should yield much faster scan decoding as usually, more than 95% of the Huffman codes - // will be 8 or fewer bits long and can be handled without looping. - fixed (short* lookaheadRef = this.Lookahead.Data) - { - var lookaheadSpan = new Span(lookaheadRef, 256); + // Figure C.2: generate the codes themselves + int k = 0; + fixed (int* valOffsetRef = this.ValOffset.Data) + fixed (uint* maxcodeRef = this.MaxCode.Data) + { + uint code = 0; + int j; + for (j = 1; j < 17; j++) + { + // Compute delta to add to code to compute symbol id. + valOffsetRef[j] = (int)(k - code); + if (sizesRef[k] == j) + { + while (sizesRef[k] == j) + { + Unsafe.Add(ref huffcodeRef, k++) = (short)code++; + } + } + + // Figure F.15: generate decoding tables for bit-sequential decoding. + // Compute largest code + 1 for this size. preshifted as need later. + maxcodeRef[j] = code << (16 - j); + code <<= 1; + } - lookaheadSpan.Fill(2034); // 9 << 8; + maxcodeRef[j] = 0xFFFFFFFF; + } - int p = 0; - for (int l = 1; l <= 8; l++) - { - for (int i = 1; i <= lengths[l]; i++, p++) + // Generate non-spec lookup tables to speed up decoding. + fixed (byte* lookaheadRef = this.Lookahead.Data) { - // l = current code's length, p = its index in huffcode[] & huffval[]. - // Generate left-justified code followed by all possible bit sequences - int lookBits = Unsafe.Add(ref huffcodeRef, p) << (8 - l); - for (int ctr = 1 << (8 - l); ctr > 0; ctr--) + const int FastBits = ScanDecoder.FastBits; + var fast = new Span(lookaheadRef, 1 << FastBits); + fast.Fill(0xFF); // Flag for non-accelerated + + for (int i = 0; i < k; i++) { - lookaheadRef[lookBits] = (short)((l << 8) | huffval[p]); - lookBits++; + int s = sizesRef[i]; + if (s <= ScanDecoder.FastBits) + { + int c = Unsafe.Add(ref huffcodeRef, i) << (FastBits - s); + int m = 1 << (FastBits - s); + for (int j = 0; j < m; j++) + { + fast[c + j] = (byte)i; + } + } } } } } + + fixed (byte* huffValRef = this.Values.Data) + { + var huffValSpan = new Span(huffValRef, 256); + values.CopyTo(huffValSpan); + } } } } \ No newline at end of file diff --git a/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/PdfJsHuffmanTables.cs b/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/PdfJsHuffmanTables.cs index 3a559bb86..5cbde2b88 100644 --- a/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/PdfJsHuffmanTables.cs +++ b/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/PdfJsHuffmanTables.cs @@ -17,7 +17,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort.Components /// Gets or sets the table at the given index. /// /// The index - /// The + /// The public ref PdfJsHuffmanTable this[int index] { [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/PdfJsScanDecoder.cs b/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/PdfJsScanDecoder.cs deleted file mode 100644 index c9f1c555d..000000000 --- a/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/PdfJsScanDecoder.cs +++ /dev/null @@ -1,866 +0,0 @@ -// Copyright (c) Six Labors and contributors. -// Licensed under the Apache License, Version 2.0. - -using System; - -#if DEBUG -using System.Diagnostics; -#endif -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using SixLabors.ImageSharp.Formats.Jpeg.Components; -using SixLabors.Memory; - -namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort.Components -{ - /// - /// Provides the means to decode a spectral scan - /// - internal struct PdfJsScanDecoder - { - private ZigZag dctZigZag; - - private byte[] markerBuffer; - - private int mcuToRead; - - private int mcusPerLine; - - private int mcu; - - private int bitsData; - - private int bitsCount; - - private int specStart; - - private int specEnd; - - private int eobrun; - - private int compIndex; - - private int successiveState; - - private int successiveACState; - - private int successiveACNextValue; - - private bool endOfStreamReached; - - private bool unexpectedMarkerReached; - - /// - /// Decodes the spectral scan - /// - /// The image frame - /// The input stream - /// The DC Huffman tables - /// The AC Huffman tables - /// The scan components - /// The component index within the array - /// The length of the components. Different to the array length - /// The reset interval - /// The spectral selection start - /// The spectral selection end - /// The successive approximation bit high end - /// The successive approximation bit low end - public void DecodeScan( - PdfJsFrame frame, - DoubleBufferedStreamReader stream, - PdfJsHuffmanTables dcHuffmanTables, - PdfJsHuffmanTables acHuffmanTables, - PdfJsFrameComponent[] components, - int componentIndex, - int componentsLength, - ushort resetInterval, - int spectralStart, - int spectralEnd, - int successivePrev, - int successive) - { - this.dctZigZag = ZigZag.CreateUnzigTable(); - this.markerBuffer = new byte[2]; - this.compIndex = componentIndex; - this.specStart = spectralStart; - this.specEnd = spectralEnd; - this.successiveState = successive; - this.endOfStreamReached = false; - this.unexpectedMarkerReached = false; - - bool progressive = frame.Progressive; - this.mcusPerLine = frame.McusPerLine; - - this.mcu = 0; - int mcuExpected; - if (componentsLength == 1) - { - mcuExpected = components[this.compIndex].WidthInBlocks * components[this.compIndex].HeightInBlocks; - } - else - { - mcuExpected = this.mcusPerLine * frame.McusPerColumn; - } - - while (this.mcu < mcuExpected) - { - // Reset interval stuff - this.mcuToRead = resetInterval != 0 ? Math.Min(mcuExpected - this.mcu, resetInterval) : mcuExpected; - for (int i = 0; i < components.Length; i++) - { - PdfJsFrameComponent c = components[i]; - c.DcPredictor = 0; - } - - this.eobrun = 0; - - if (!progressive) - { - this.DecodeScanBaseline(dcHuffmanTables, acHuffmanTables, components, componentsLength, stream); - } - else - { - bool isAc = this.specStart != 0; - bool isFirst = successivePrev == 0; - PdfJsHuffmanTables huffmanTables = isAc ? acHuffmanTables : dcHuffmanTables; - this.DecodeScanProgressive(huffmanTables, isAc, isFirst, components, componentsLength, stream); - } - - // Reset - // TODO: I do not understand why these values are reset? We should surely be tracking the bits across mcu's? - this.bitsCount = 0; - this.bitsData = 0; - this.unexpectedMarkerReached = false; - - // Some images include more scan blocks than expected, skip past those and - // attempt to find the next valid marker - PdfJsFileMarker fileMarker = PdfJsJpegDecoderCore.FindNextFileMarker(this.markerBuffer, stream); - byte marker = fileMarker.Marker; - - // RSTn - We've already read the bytes and altered the position so no need to skip - if (marker >= JpegConstants.Markers.RST0 && marker <= JpegConstants.Markers.RST7) - { - continue; - } - - if (!fileMarker.Invalid) - { - // We've found a valid marker. - // Rewind the stream to the position of the marker and break - stream.Position = fileMarker.Position; - break; - } - -#if DEBUG - Debug.WriteLine($"DecodeScan - Unexpected MCU data at {stream.Position}, next marker is: {fileMarker.Marker:X}"); -#endif - } - } - - private void DecodeScanBaseline( - PdfJsHuffmanTables dcHuffmanTables, - PdfJsHuffmanTables acHuffmanTables, - PdfJsFrameComponent[] components, - int componentsLength, - DoubleBufferedStreamReader stream) - { - if (componentsLength == 1) - { - PdfJsFrameComponent component = components[this.compIndex]; - ref short blockDataRef = ref MemoryMarshal.GetReference(MemoryMarshal.Cast(component.SpectralBlocks.GetSpan())); - ref PdfJsHuffmanTable dcHuffmanTable = ref dcHuffmanTables[component.DCHuffmanTableId]; - ref PdfJsHuffmanTable acHuffmanTable = ref acHuffmanTables[component.ACHuffmanTableId]; - - for (int n = 0; n < this.mcuToRead; n++) - { - if (this.endOfStreamReached || this.unexpectedMarkerReached) - { - continue; - } - - this.DecodeBlockBaseline(ref dcHuffmanTable, ref acHuffmanTable, component, ref blockDataRef, stream); - this.mcu++; - } - } - else - { - for (int n = 0; n < this.mcuToRead; n++) - { - for (int i = 0; i < componentsLength; i++) - { - PdfJsFrameComponent component = components[i]; - ref short blockDataRef = ref MemoryMarshal.GetReference(MemoryMarshal.Cast(component.SpectralBlocks.GetSpan())); - ref PdfJsHuffmanTable dcHuffmanTable = ref dcHuffmanTables[component.DCHuffmanTableId]; - ref PdfJsHuffmanTable acHuffmanTable = ref acHuffmanTables[component.ACHuffmanTableId]; - int h = component.HorizontalSamplingFactor; - int v = component.VerticalSamplingFactor; - - for (int j = 0; j < v; j++) - { - for (int k = 0; k < h; k++) - { - if (this.endOfStreamReached || this.unexpectedMarkerReached) - { - continue; - } - - this.DecodeMcuBaseline(ref dcHuffmanTable, ref acHuffmanTable, component, ref blockDataRef, j, k, stream); - } - } - } - - this.mcu++; - } - } - } - - private void DecodeScanProgressive( - PdfJsHuffmanTables huffmanTables, - bool isAC, - bool isFirst, - PdfJsFrameComponent[] components, - int componentsLength, - DoubleBufferedStreamReader stream) - { - if (componentsLength == 1) - { - PdfJsFrameComponent component = components[this.compIndex]; - ref short blockDataRef = ref MemoryMarshal.GetReference(MemoryMarshal.Cast(component.SpectralBlocks.GetSpan())); - ref PdfJsHuffmanTable huffmanTable = ref huffmanTables[isAC ? component.ACHuffmanTableId : component.DCHuffmanTableId]; - - for (int n = 0; n < this.mcuToRead; n++) - { - if (this.endOfStreamReached || this.unexpectedMarkerReached) - { - continue; - } - - if (isAC) - { - if (isFirst) - { - this.DecodeBlockACFirst(ref huffmanTable, component, ref blockDataRef, stream); - } - else - { - this.DecodeBlockACSuccessive(ref huffmanTable, component, ref blockDataRef, stream); - } - } - else - { - if (isFirst) - { - this.DecodeBlockDCFirst(ref huffmanTable, component, ref blockDataRef, stream); - } - else - { - this.DecodeBlockDCSuccessive(component, ref blockDataRef, stream); - } - } - - this.mcu++; - } - } - else - { - for (int n = 0; n < this.mcuToRead; n++) - { - for (int i = 0; i < componentsLength; i++) - { - PdfJsFrameComponent component = components[i]; - ref short blockDataRef = ref MemoryMarshal.GetReference(MemoryMarshal.Cast(component.SpectralBlocks.GetSpan())); - ref PdfJsHuffmanTable huffmanTable = ref huffmanTables[isAC ? component.ACHuffmanTableId : component.DCHuffmanTableId]; - int h = component.HorizontalSamplingFactor; - int v = component.VerticalSamplingFactor; - - for (int j = 0; j < v; j++) - { - for (int k = 0; k < h; k++) - { - // No need to continue here. - if (this.endOfStreamReached || this.unexpectedMarkerReached) - { - break; - } - - if (isAC) - { - if (isFirst) - { - this.DecodeMcuACFirst(ref huffmanTable, component, ref blockDataRef, j, k, stream); - } - else - { - this.DecodeMcuACSuccessive(ref huffmanTable, component, ref blockDataRef, j, k, stream); - } - } - else - { - if (isFirst) - { - this.DecodeMcuDCFirst(ref huffmanTable, component, ref blockDataRef, j, k, stream); - } - else - { - this.DecodeMcuDCSuccessive(component, ref blockDataRef, j, k, stream); - } - } - } - } - } - - this.mcu++; - } - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private void DecodeBlockBaseline(ref PdfJsHuffmanTable dcHuffmanTable, ref PdfJsHuffmanTable acHuffmanTable, PdfJsFrameComponent component, ref short blockDataRef, DoubleBufferedStreamReader stream) - { - int blockRow = this.mcu / component.WidthInBlocks; - int blockCol = this.mcu % component.WidthInBlocks; - int offset = component.GetBlockBufferOffset(blockRow, blockCol); - this.DecodeBaseline(component, ref blockDataRef, offset, ref dcHuffmanTable, ref acHuffmanTable, stream); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private void DecodeMcuBaseline(ref PdfJsHuffmanTable dcHuffmanTable, ref PdfJsHuffmanTable acHuffmanTable, PdfJsFrameComponent component, ref short blockDataRef, int row, int col, DoubleBufferedStreamReader stream) - { - int mcuRow = this.mcu / this.mcusPerLine; - int mcuCol = this.mcu % this.mcusPerLine; - int blockRow = (mcuRow * component.VerticalSamplingFactor) + row; - int blockCol = (mcuCol * component.HorizontalSamplingFactor) + col; - int offset = component.GetBlockBufferOffset(blockRow, blockCol); - this.DecodeBaseline(component, ref blockDataRef, offset, ref dcHuffmanTable, ref acHuffmanTable, stream); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private void DecodeBlockDCFirst(ref PdfJsHuffmanTable dcHuffmanTable, PdfJsFrameComponent component, ref short blockDataRef, DoubleBufferedStreamReader stream) - { - int blockRow = this.mcu / component.WidthInBlocks; - int blockCol = this.mcu % component.WidthInBlocks; - int offset = component.GetBlockBufferOffset(blockRow, blockCol); - this.DecodeDCFirst(component, ref blockDataRef, offset, ref dcHuffmanTable, stream); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private void DecodeMcuDCFirst(ref PdfJsHuffmanTable dcHuffmanTable, PdfJsFrameComponent component, ref short blockDataRef, int row, int col, DoubleBufferedStreamReader stream) - { - int mcuRow = this.mcu / this.mcusPerLine; - int mcuCol = this.mcu % this.mcusPerLine; - int blockRow = (mcuRow * component.VerticalSamplingFactor) + row; - int blockCol = (mcuCol * component.HorizontalSamplingFactor) + col; - int offset = component.GetBlockBufferOffset(blockRow, blockCol); - this.DecodeDCFirst(component, ref blockDataRef, offset, ref dcHuffmanTable, stream); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private void DecodeBlockDCSuccessive(PdfJsFrameComponent component, ref short blockDataRef, DoubleBufferedStreamReader stream) - { - int blockRow = this.mcu / component.WidthInBlocks; - int blockCol = this.mcu % component.WidthInBlocks; - int offset = component.GetBlockBufferOffset(blockRow, blockCol); - this.DecodeDCSuccessive(component, ref blockDataRef, offset, stream); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private void DecodeMcuDCSuccessive(PdfJsFrameComponent component, ref short blockDataRef, int row, int col, DoubleBufferedStreamReader stream) - { - int mcuRow = this.mcu / this.mcusPerLine; - int mcuCol = this.mcu % this.mcusPerLine; - int blockRow = (mcuRow * component.VerticalSamplingFactor) + row; - int blockCol = (mcuCol * component.HorizontalSamplingFactor) + col; - int offset = component.GetBlockBufferOffset(blockRow, blockCol); - this.DecodeDCSuccessive(component, ref blockDataRef, offset, stream); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private void DecodeBlockACFirst(ref PdfJsHuffmanTable acHuffmanTable, PdfJsFrameComponent component, ref short blockDataRef, DoubleBufferedStreamReader stream) - { - int blockRow = this.mcu / component.WidthInBlocks; - int blockCol = this.mcu % component.WidthInBlocks; - int offset = component.GetBlockBufferOffset(blockRow, blockCol); - this.DecodeACFirst(ref blockDataRef, offset, ref acHuffmanTable, stream); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private void DecodeMcuACFirst(ref PdfJsHuffmanTable acHuffmanTable, PdfJsFrameComponent component, ref short blockDataRef, int row, int col, DoubleBufferedStreamReader stream) - { - int mcuRow = this.mcu / this.mcusPerLine; - int mcuCol = this.mcu % this.mcusPerLine; - int blockRow = (mcuRow * component.VerticalSamplingFactor) + row; - int blockCol = (mcuCol * component.HorizontalSamplingFactor) + col; - int offset = component.GetBlockBufferOffset(blockRow, blockCol); - this.DecodeACFirst(ref blockDataRef, offset, ref acHuffmanTable, stream); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private void DecodeBlockACSuccessive(ref PdfJsHuffmanTable acHuffmanTable, PdfJsFrameComponent component, ref short blockDataRef, DoubleBufferedStreamReader stream) - { - int blockRow = this.mcu / component.WidthInBlocks; - int blockCol = this.mcu % component.WidthInBlocks; - int offset = component.GetBlockBufferOffset(blockRow, blockCol); - this.DecodeACSuccessive(ref blockDataRef, offset, ref acHuffmanTable, stream); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private void DecodeMcuACSuccessive(ref PdfJsHuffmanTable acHuffmanTable, PdfJsFrameComponent component, ref short blockDataRef, int row, int col, DoubleBufferedStreamReader stream) - { - int mcuRow = this.mcu / this.mcusPerLine; - int mcuCol = this.mcu % this.mcusPerLine; - int blockRow = (mcuRow * component.VerticalSamplingFactor) + row; - int blockCol = (mcuCol * component.HorizontalSamplingFactor) + col; - int offset = component.GetBlockBufferOffset(blockRow, blockCol); - this.DecodeACSuccessive(ref blockDataRef, offset, ref acHuffmanTable, stream); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private bool TryReadBit(DoubleBufferedStreamReader stream, out int bit) - { - if (this.bitsCount == 0) - { - if (!this.TryFillBits(stream)) - { - bit = 0; - return false; - } - } - - this.bitsCount--; - bit = (this.bitsData >> this.bitsCount) & 1; - return true; - } - - [MethodImpl(MethodImplOptions.NoInlining)] - private bool TryFillBits(DoubleBufferedStreamReader stream) - { - // TODO: Read more then 1 byte at a time. - // In LibJpegTurbo this is be 25 bits (32-7) but I cannot get this to work - // for some images, I'm assuming because I am crossing MCU boundaries and not maintining the correct buffer state. - const int MinGetBits = 7; - - if (!this.unexpectedMarkerReached) - { - // Attempt to load to the minimum bit count. - while (this.bitsCount < MinGetBits) - { - int c = stream.ReadByte(); - - switch (c) - { - case -0x1: - - // We've encountered the end of the file stream which means there's no EOI marker in the image. - this.endOfStreamReached = true; - return false; - - case JpegConstants.Markers.XFF: - int nextByte = stream.ReadByte(); - - if (nextByte == -0x1) - { - this.endOfStreamReached = true; - return false; - } - - if (nextByte != 0) - { -#if DEBUG - Debug.WriteLine($"DecodeScan - Unexpected marker {(c << 8) | nextByte:X} at {stream.Position}"); -#endif - - // We've encountered an unexpected marker. Reverse the stream and exit. - this.unexpectedMarkerReached = true; - stream.Position -= 2; - - // TODO: double check we need this. - // Fill buffer with zero bits. - if (this.bitsCount == 0) - { - this.bitsData <<= MinGetBits; - this.bitsCount = MinGetBits; - } - - return true; - } - - break; - } - - // OK, load the next byte into bitsData - this.bitsData = (this.bitsData << 8) | c; - this.bitsCount += 8; - } - } - - return true; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private int PeekBits(int count) - { - return this.bitsData >> (this.bitsCount - count) & ((1 << count) - 1); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private void DropBits(int count) - { - this.bitsCount -= count; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private bool TryDecodeHuffman(ref PdfJsHuffmanTable tree, DoubleBufferedStreamReader stream, out short value) - { - value = -1; - - // TODO: Implement fast Huffman decoding. - // In LibJpegTurbo a minimum of 25 bits (32-7) is collected from the stream - // Then a LUT is used to avoid the loop when decoding the Huffman value. - // using 3 methods: FillBits, PeekBits, and DropBits. - // The LUT has been ported from LibJpegTurbo as has this code but it doesn't work. - // this.TryFillBits(stream); - // - // const int LookAhead = 8; - // int look = this.PeekBits(LookAhead); - // look = tree.Lookahead[look]; - // int bits = look >> LookAhead; - // - // if (bits <= LookAhead) - // { - // this.DropBits(bits); - // value = (short)(look & ((1 << LookAhead) - 1)); - // return true; - // } - if (!this.TryReadBit(stream, out int bit)) - { - return false; - } - - short code = (short)bit; - - // "DECODE", section F.2.2.3, figure F.16, page 109 of T.81 - int i = 1; - - while (code > tree.MaxCode[i]) - { - if (!this.TryReadBit(stream, out bit)) - { - return false; - } - - code <<= 1; - code |= (short)bit; - i++; - } - - int j = tree.ValOffset[i]; - value = tree.HuffVal[(j + code) & 0xFF]; - return true; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private bool TryReceive(int length, DoubleBufferedStreamReader stream, out int value) - { - value = 0; - while (length > 0) - { - if (!this.TryReadBit(stream, out int bit)) - { - return false; - } - - value = (value << 1) | bit; - length--; - } - - return true; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private bool TryReceiveAndExtend(int length, DoubleBufferedStreamReader stream, out int value) - { - if (length == 1) - { - if (!this.TryReadBit(stream, out value)) - { - return false; - } - - value = value == 1 ? 1 : -1; - } - else - { - if (!this.TryReceive(length, stream, out value)) - { - return false; - } - - if (value < 1 << (length - 1)) - { - value += (-1 << length) + 1; - } - } - - return true; - } - - private void DecodeBaseline(PdfJsFrameComponent component, ref short blockDataRef, int offset, ref PdfJsHuffmanTable dcHuffmanTable, ref PdfJsHuffmanTable acHuffmanTable, DoubleBufferedStreamReader stream) - { - if (!this.TryDecodeHuffman(ref dcHuffmanTable, stream, out short t)) - { - return; - } - - int diff = 0; - if (t != 0) - { - if (!this.TryReceiveAndExtend(t, stream, out diff)) - { - return; - } - } - - Unsafe.Add(ref blockDataRef, offset) = (short)(component.DcPredictor += diff); - - int k = 1; - while (k < 64) - { - if (!this.TryDecodeHuffman(ref acHuffmanTable, stream, out short rs)) - { - return; - } - - int s = rs & 15; - int r = rs >> 4; - - if (s == 0) - { - if (r < 15) - { - break; - } - - k += 16; - continue; - } - - k += r; - - byte z = this.dctZigZag[k]; - - if (!this.TryReceiveAndExtend(s, stream, out int re)) - { - return; - } - - Unsafe.Add(ref blockDataRef, offset + z) = (short)re; - k++; - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private void DecodeDCFirst(PdfJsFrameComponent component, ref short blockDataRef, int offset, ref PdfJsHuffmanTable dcHuffmanTable, DoubleBufferedStreamReader stream) - { - if (!this.TryDecodeHuffman(ref dcHuffmanTable, stream, out short t)) - { - return; - } - - int diff = 0; - if (t != 0) - { - if (!this.TryReceiveAndExtend(t, stream, out diff)) - { - return; - } - } - - Unsafe.Add(ref blockDataRef, offset) = (short)(component.DcPredictor += diff << this.successiveState); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private void DecodeDCSuccessive(PdfJsFrameComponent component, ref short blockDataRef, int offset, DoubleBufferedStreamReader stream) - { - if (!this.TryReadBit(stream, out int bit)) - { - return; - } - - Unsafe.Add(ref blockDataRef, offset) |= (short)(bit << this.successiveState); - } - - private void DecodeACFirst(ref short blockDataRef, int offset, ref PdfJsHuffmanTable acHuffmanTable, DoubleBufferedStreamReader stream) - { - if (this.eobrun > 0) - { - this.eobrun--; - return; - } - - int k = this.specStart; - int e = this.specEnd; - while (k <= e) - { - if (!this.TryDecodeHuffman(ref acHuffmanTable, stream, out short rs)) - { - return; - } - - int s = rs & 15; - int r = rs >> 4; - - if (s == 0) - { - if (r < 15) - { - if (!this.TryReceive(r, stream, out int eob)) - { - return; - } - - this.eobrun = eob + (1 << r) - 1; - break; - } - - k += 16; - continue; - } - - k += r; - - byte z = this.dctZigZag[k]; - - if (!this.TryReceiveAndExtend(s, stream, out int v)) - { - return; - } - - Unsafe.Add(ref blockDataRef, offset + z) = (short)(v * (1 << this.successiveState)); - k++; - } - } - - private void DecodeACSuccessive(ref short blockDataRef, int offset, ref PdfJsHuffmanTable acHuffmanTable, DoubleBufferedStreamReader stream) - { - int k = this.specStart; - int e = this.specEnd; - int r = 0; - - while (k <= e) - { - int offsetZ = offset + this.dctZigZag[k]; - ref short blockOffsetZRef = ref Unsafe.Add(ref blockDataRef, offsetZ); - int sign = blockOffsetZRef < 0 ? -1 : 1; - - switch (this.successiveACState) - { - case 0: // Initial state - - if (!this.TryDecodeHuffman(ref acHuffmanTable, stream, out short rs)) - { - return; - } - - int s = rs & 15; - r = rs >> 4; - if (s == 0) - { - if (r < 15) - { - if (!this.TryReceive(r, stream, out int eob)) - { - return; - } - - this.eobrun = eob + (1 << r); - this.successiveACState = 4; - } - else - { - r = 16; - this.successiveACState = 1; - } - } - else - { - if (s != 1) - { - throw new ImageFormatException("Invalid ACn encoding"); - } - - if (!this.TryReceiveAndExtend(s, stream, out int v)) - { - return; - } - - this.successiveACNextValue = v; - this.successiveACState = r > 0 ? 2 : 3; - } - - continue; - case 1: // Skipping r zero items - case 2: - if (blockOffsetZRef != 0) - { - if (!this.TryReadBit(stream, out int bit)) - { - return; - } - - blockOffsetZRef += (short)(sign * (bit << this.successiveState)); - } - else - { - r--; - if (r == 0) - { - this.successiveACState = this.successiveACState == 2 ? 3 : 0; - } - } - - break; - case 3: // Set value for a zero item - if (blockOffsetZRef != 0) - { - if (!this.TryReadBit(stream, out int bit)) - { - return; - } - - blockOffsetZRef += (short)(sign * (bit << this.successiveState)); - } - else - { - blockOffsetZRef = (short)(this.successiveACNextValue << this.successiveState); - this.successiveACState = 0; - } - - break; - case 4: // Eob - if (blockOffsetZRef != 0) - { - if (!this.TryReadBit(stream, out int bit)) - { - return; - } - - blockOffsetZRef += (short)(sign * (bit << this.successiveState)); - } - - break; - } - - k++; - } - - if (this.successiveACState == 4) - { - this.eobrun--; - if (this.eobrun == 0) - { - this.successiveACState = 0; - } - } - } - } -} \ No newline at end of file diff --git a/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/ScanDecoder.cs b/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/ScanDecoder.cs new file mode 100644 index 000000000..8575bac69 --- /dev/null +++ b/src/ImageSharp/Formats/Jpeg/PdfJsPort/Components/ScanDecoder.cs @@ -0,0 +1,958 @@ +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using SixLabors.ImageSharp.Formats.Jpeg.Components; + +namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort.Components +{ + /// + /// Decodes the Huffman encoded spectral scan. + /// Originally ported from + /// with additional fixes for both performance and common encoding errors. + /// + internal class ScanDecoder + { + // The number of bits that can be read via a LUT. + public const int FastBits = 9; + + // LUT mask for n rightmost bits. Bmask[n] = (1 << n) - 1 + private static readonly uint[] Bmask = { 0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535 }; + + // LUT Bias[n] = (-1 << n) + 1 + private static readonly int[] Bias = { 0, -1, -3, -7, -15, -31, -63, -127, -255, -511, -1023, -2047, -4095, -8191, -16383, -32767 }; + + private readonly PdfJsFrame frame; + private readonly PdfJsHuffmanTables dcHuffmanTables; + private readonly PdfJsHuffmanTables acHuffmanTables; + private readonly FastACTables fastACTables; + + private readonly DoubleBufferedStreamReader stream; + private readonly PdfJsFrameComponent[] components; + private readonly ZigZag dctZigZag; + + // The restart interval. + private readonly int restartInterval; + + // The current component index. + private readonly int componentIndex; + + // The number of interleaved components. + private readonly int componentsLength; + + // The spectral selection start. + private readonly int spectralStart; + + // The spectral selection end. + private readonly int spectralEnd; + + // The successive approximation high bit end. + private readonly int successiveHigh; + + // The successive approximation low bit end. + private readonly int successiveLow; + + // The number of valid bits left to read in the buffer. + private int codeBits; + + // The entropy encoded code buffer. + private uint codeBuffer; + + // Whether there is more data to pull from the stream for the current mcu. + private bool nomore; + + // Whether we have prematurely reached the end of the file. + private bool eof; + + // The current, if any, marker in the input stream. + private byte marker; + + // Whether we have a bad marker, I.E. One that is not between RST0 and RST7 + private bool badMarker; + + // The opening position of an identified marker. + private long markerPosition; + + // How many mcu's are left to do. + private int todo; + + // The End-Of-Block countdown for ending the sequence prematurely when the remaining coefficients are zero. + private int eobrun; + + /// + /// Initializes a new instance of the class. + /// + /// The input stream. + /// The image frame. + /// The DC Huffman tables. + /// The AC Huffman tables. + /// The fast AC decoding tables. + /// The component index within the array. + /// The length of the components. Different to the array length. + /// The reset interval. + /// The spectral selection start. + /// The spectral selection end. + /// The successive approximation bit high end. + /// The successive approximation bit low end. + public ScanDecoder( + DoubleBufferedStreamReader stream, + PdfJsFrame frame, + PdfJsHuffmanTables dcHuffmanTables, + PdfJsHuffmanTables acHuffmanTables, + FastACTables fastACTables, + int componentIndex, + int componentsLength, + int restartInterval, + int spectralStart, + int spectralEnd, + int successiveHigh, + int successiveLow) + { + this.dctZigZag = ZigZag.CreateUnzigTable(); + this.stream = stream; + this.frame = frame; + this.dcHuffmanTables = dcHuffmanTables; + this.acHuffmanTables = acHuffmanTables; + this.fastACTables = fastACTables; + this.components = frame.Components; + this.marker = JpegConstants.Markers.XFF; + this.markerPosition = 0; + this.componentIndex = componentIndex; + this.componentsLength = componentsLength; + this.restartInterval = restartInterval; + this.spectralStart = spectralStart; + this.spectralEnd = spectralEnd; + this.successiveHigh = successiveHigh; + this.successiveLow = successiveLow; + } + + /// + /// Decodes the entropy coded data. + /// + public void ParseEntropyCodedData() + { + this.Reset(); + + if (!this.frame.Progressive) + { + this.ParseBaselineData(); + } + else + { + this.ParseProgressiveData(); + } + + if (this.badMarker) + { + this.stream.Position = this.markerPosition; + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static uint LRot(uint x, int y) => (x << y) | (x >> (32 - y)); + + private void ParseBaselineData() + { + if (this.componentsLength == 1) + { + this.ParseBaselineDataNonInterleaved(); + } + else + { + this.ParseBaselineDataInterleaved(); + } + } + + private void ParseBaselineDataInterleaved() + { + // Interleaved + int mcu = 0; + int mcusPerColumn = this.frame.McusPerColumn; + int mcusPerLine = this.frame.McusPerLine; + for (int j = 0; j < mcusPerColumn; j++) + { + for (int i = 0; i < mcusPerLine; i++) + { + // Scan an interleaved mcu... process components in order + for (int k = 0; k < this.componentsLength; k++) + { + PdfJsFrameComponent component = this.components[k]; + + ref PdfJsHuffmanTable dcHuffmanTable = ref this.dcHuffmanTables[component.DCHuffmanTableId]; + ref PdfJsHuffmanTable acHuffmanTable = ref this.acHuffmanTables[component.ACHuffmanTableId]; + ref short fastACRef = ref this.fastACTables.GetAcTableReference(component); + int h = component.HorizontalSamplingFactor; + int v = component.VerticalSamplingFactor; + + // Scan out an mcu's worth of this component; that's just determined + // by the basic H and V specified for the component + for (int y = 0; y < v; y++) + { + for (int x = 0; x < h; x++) + { + if (this.eof) + { + return; + } + + int mcuRow = mcu / mcusPerLine; + int mcuCol = mcu % mcusPerLine; + int blockRow = (mcuRow * v) + y; + int blockCol = (mcuCol * h) + x; + + this.DecodeBlockBaseline( + component, + blockRow, + blockCol, + ref dcHuffmanTable, + ref acHuffmanTable, + ref fastACRef); + } + } + } + + // After all interleaved components, that's an interleaved MCU, + // so now count down the restart interval + mcu++; + if (!this.ContinueOnMcuComplete()) + { + return; + } + } + } + } + + /// + /// Non-interleaved data, we just need to process one block at a ti + /// in trivial scanline order + /// number of blocks to do just depends on how many actual "pixels" + /// component has, independent of interleaved MCU blocking and such + /// + private void ParseBaselineDataNonInterleaved() + { + PdfJsFrameComponent component = this.components[this.componentIndex]; + + int w = component.WidthInBlocks; + int h = component.HeightInBlocks; + + ref PdfJsHuffmanTable dcHuffmanTable = ref this.dcHuffmanTables[component.DCHuffmanTableId]; + ref PdfJsHuffmanTable acHuffmanTable = ref this.acHuffmanTables[component.ACHuffmanTableId]; + ref short fastACRef = ref this.fastACTables.GetAcTableReference(component); + + int mcu = 0; + for (int j = 0; j < h; j++) + { + for (int i = 0; i < w; i++) + { + if (this.eof) + { + return; + } + + int blockRow = mcu / w; + int blockCol = mcu % w; + + this.DecodeBlockBaseline( + component, + blockRow, + blockCol, + ref dcHuffmanTable, + ref acHuffmanTable, + ref fastACRef); + + // Every data block is an MCU, so countdown the restart interval + mcu++; + if (!this.ContinueOnMcuComplete()) + { + return; + } + } + } + } + + private void ParseProgressiveData() + { + if (this.componentsLength == 1) + { + this.ParseProgressiveDataNonInterleaved(); + } + else + { + this.ParseProgressiveDataInterleaved(); + } + } + + private void ParseProgressiveDataInterleaved() + { + // Interleaved + int mcu = 0; + int mcusPerColumn = this.frame.McusPerColumn; + int mcusPerLine = this.frame.McusPerLine; + for (int j = 0; j < mcusPerColumn; j++) + { + for (int i = 0; i < mcusPerLine; i++) + { + // Scan an interleaved mcu... process components in order + for (int k = 0; k < this.componentsLength; k++) + { + PdfJsFrameComponent component = this.components[k]; + ref PdfJsHuffmanTable dcHuffmanTable = ref this.dcHuffmanTables[component.DCHuffmanTableId]; + int h = component.HorizontalSamplingFactor; + int v = component.VerticalSamplingFactor; + + // Scan out an mcu's worth of this component; that's just determined + // by the basic H and V specified for the component + for (int y = 0; y < v; y++) + { + for (int x = 0; x < h; x++) + { + if (this.eof) + { + return; + } + + int mcuRow = mcu / mcusPerLine; + int mcuCol = mcu % mcusPerLine; + int blockRow = (mcuRow * v) + y; + int blockCol = (mcuCol * h) + x; + + this.DecodeBlockProgressiveDC( + component, + blockRow, + blockCol, + ref dcHuffmanTable); + } + } + } + + // After all interleaved components, that's an interleaved MCU, + // so now count down the restart interval + mcu++; + if (!this.ContinueOnMcuComplete()) + { + return; + } + } + } + } + + /// + /// Non-interleaved data, we just need to process one block at a time, + /// in trivial scanline order + /// number of blocks to do just depends on how many actual "pixels" this + /// component has, independent of interleaved MCU blocking and such + /// + private void ParseProgressiveDataNonInterleaved() + { + PdfJsFrameComponent component = this.components[this.componentIndex]; + + int w = component.WidthInBlocks; + int h = component.HeightInBlocks; + + ref PdfJsHuffmanTable dcHuffmanTable = ref this.dcHuffmanTables[component.DCHuffmanTableId]; + ref PdfJsHuffmanTable acHuffmanTable = ref this.acHuffmanTables[component.ACHuffmanTableId]; + ref short fastACRef = ref this.fastACTables.GetAcTableReference(component); + + int mcu = 0; + for (int j = 0; j < h; j++) + { + for (int i = 0; i < w; i++) + { + if (this.eof) + { + return; + } + + int blockRow = mcu / w; + int blockCol = mcu % w; + + if (this.spectralStart == 0) + { + this.DecodeBlockProgressiveDC( + component, + blockRow, + blockCol, + ref dcHuffmanTable); + } + else + { + this.DecodeBlockProgressiveAC( + component, + blockRow, + blockCol, + ref acHuffmanTable, + ref fastACRef); + } + + // Every data block is an MCU, so countdown the restart interval + mcu++; + if (!this.ContinueOnMcuComplete()) + { + return; + } + } + } + } + + private void DecodeBlockBaseline( + PdfJsFrameComponent component, + int row, + int col, + ref PdfJsHuffmanTable dcTable, + ref PdfJsHuffmanTable acTable, + ref short fastACRef) + { + this.CheckBits(); + int t = this.DecodeHuffman(ref dcTable); + + if (t < 0) + { + JpegThrowHelper.ThrowBadHuffmanCode(); + } + + ref short blockDataRef = ref component.GetBlockDataReference(row, col); + + int diff = t != 0 ? this.ExtendReceive(t) : 0; + int dc = component.DcPredictor + diff; + component.DcPredictor = dc; + blockDataRef = (short)dc; + + // Decode AC Components, See Jpeg Spec + int k = 1; + do + { + int zig; + int s; + + this.CheckBits(); + int c = this.PeekBits(); + int r = Unsafe.Add(ref fastACRef, c); + + if (r != 0) + { + // Fast AC path + k += (r >> 4) & 15; // Run + s = r & 15; // Combined Length + this.codeBuffer <<= s; + this.codeBits -= s; + + // Decode into unzigzag location + zig = this.dctZigZag[k++]; + Unsafe.Add(ref blockDataRef, zig) = (short)(r >> 8); + } + else + { + int rs = this.DecodeHuffman(ref acTable); + + if (rs < 0) + { + JpegThrowHelper.ThrowBadHuffmanCode(); + } + + s = rs & 15; + r = rs >> 4; + + if (s == 0) + { + if (rs != 0xF0) + { + break; // End block + } + + k += 16; + } + else + { + k += r; + + // Decode into unzigzag location + zig = this.dctZigZag[k++]; + Unsafe.Add(ref blockDataRef, zig) = (short)this.ExtendReceive(s); + } + } + } while (k < 64); + } + + private void DecodeBlockProgressiveDC( + PdfJsFrameComponent component, + int row, + int col, + ref PdfJsHuffmanTable dcTable) + { + if (this.spectralEnd != 0) + { + JpegThrowHelper.ThrowImageFormatException("Can't merge DC and AC."); + } + + this.CheckBits(); + + ref short blockDataRef = ref component.GetBlockDataReference(row, col); + + if (this.successiveHigh == 0) + { + // First scan for DC coefficient, must be first + int t = this.DecodeHuffman(ref dcTable); + int diff = t != 0 ? this.ExtendReceive(t) : 0; + + int dc = component.DcPredictor + diff; + component.DcPredictor = dc; + + blockDataRef = (short)(dc << this.successiveLow); + } + else + { + // Refinement scan for DC coefficient + if (this.GetBit() != 0) + { + blockDataRef += (short)(1 << this.successiveLow); + } + } + } + + private void DecodeBlockProgressiveAC( + PdfJsFrameComponent component, + int row, + int col, + ref PdfJsHuffmanTable acTable, + ref short fastACRef) + { + if (this.spectralStart == 0) + { + JpegThrowHelper.ThrowImageFormatException("Can't merge DC and AC."); + } + + ref short blockDataRef = ref component.GetBlockDataReference(row, col); + + if (this.successiveHigh == 0) + { + // MCU decoding for AC initial scan (either spectral selection, + // or first pass of successive approximation). + int shift = this.successiveLow; + + if (this.eobrun != 0) + { + this.eobrun--; + return; + } + + int k = this.spectralStart; + do + { + int zig; + int s; + + this.CheckBits(); + int c = this.PeekBits(); + int r = Unsafe.Add(ref fastACRef, c); + + if (r != 0) + { + // Fast AC path + k += (r >> 4) & 15; // Run + s = r & 15; // Combined length + this.codeBuffer <<= s; + this.codeBits -= s; + + // Decode into unzigzag location + zig = this.dctZigZag[k++]; + Unsafe.Add(ref blockDataRef, zig) = (short)((r >> 8) << shift); + } + else + { + int rs = this.DecodeHuffman(ref acTable); + + if (rs < 0) + { + JpegThrowHelper.ThrowBadHuffmanCode(); + } + + s = rs & 15; + r = rs >> 4; + + if (s == 0) + { + if (r < 15) + { + this.eobrun = 1 << r; + if (r != 0) + { + this.eobrun += this.GetBits(r); + } + + this.eobrun--; + break; + } + + k += 16; + } + else + { + k += r; + zig = this.dctZigZag[k++]; + Unsafe.Add(ref blockDataRef, zig) = (short)(this.ExtendReceive(s) << shift); + } + } + } + while (k <= this.spectralEnd); + } + else + { + // Refinement scan for these AC coefficients + this.DecodeBlockProgressiveACRefined(ref blockDataRef, ref acTable); + } + } + + private void DecodeBlockProgressiveACRefined(ref short blockDataRef, ref PdfJsHuffmanTable acTable) + { + int k; + + // Refinement scan for these AC coefficients + short bit = (short)(1 << this.successiveLow); + + if (this.eobrun != 0) + { + this.eobrun--; + for (k = this.spectralStart; k <= this.spectralEnd; k++) + { + ref short p = ref Unsafe.Add(ref blockDataRef, this.dctZigZag[k]); + if (p != 0) + { + if (this.GetBit() != 0) + { + if ((p & bit) == 0) + { + if (p > 0) + { + p += bit; + } + else + { + p -= bit; + } + } + } + } + } + } + else + { + k = this.spectralStart; + do + { + int rs = this.DecodeHuffman(ref acTable); + if (rs < 0) + { + JpegThrowHelper.ThrowBadHuffmanCode(); + } + + int s = rs & 15; + int r = rs >> 4; + + if (s == 0) + { + // r=15 s=0 should write 16 0s, so we just do + // a run of 15 0s and then write s (which is 0), + // so we don't have to do anything special here + if (r < 15) + { + this.eobrun = (1 << r) - 1; + + if (r != 0) + { + this.eobrun += this.GetBits(r); + } + + r = 64; // Force end of block + } + } + else + { + if (s != 1) + { + JpegThrowHelper.ThrowBadHuffmanCode(); + } + + // Sign bit + if (this.GetBit() != 0) + { + s = bit; + } + else + { + s = -bit; + } + } + + // Advance by r + while (k <= this.spectralEnd) + { + ref short p = ref Unsafe.Add(ref blockDataRef, this.dctZigZag[k++]); + if (p != 0) + { + if (this.GetBit() != 0) + { + if ((p & bit) == 0) + { + if (p > 0) + { + p += bit; + } + else + { + p -= bit; + } + } + } + } + else + { + if (r == 0) + { + p = (short)s; + break; + } + + r--; + } + } + } + while (k <= this.spectralEnd); + } + } + + [MethodImpl(InliningOptions.ShortMethod)] + private int GetBits(int n) + { + if (this.codeBits < n) + { + this.FillBuffer(); + } + + uint k = LRot(this.codeBuffer, n); + this.codeBuffer = k & ~Bmask[n]; + k &= Bmask[n]; + this.codeBits -= n; + return (int)k; + } + + [MethodImpl(InliningOptions.ShortMethod)] + private int GetBit() + { + if (this.codeBits < 1) + { + this.FillBuffer(); + } + + uint k = this.codeBuffer; + this.codeBuffer <<= 1; + this.codeBits--; + + return (int)(k & 0x80000000); + } + + [MethodImpl(InliningOptions.ColdPath)] + private void FillBuffer() + { + // Attempt to load at least the minimum nbumber of required bits into the buffer. + // We fail to do so only if we hit a marker or reach the end of the input stream. + do + { + int b = this.nomore ? 0 : this.stream.ReadByte(); + + if (b == -1) + { + // We've encountered the end of the file stream which means there's no EOI marker in the image + // or the SOS marker has the wrong dimensions set. + this.eof = true; + b = 0; + } + + // Found a marker. + if (b == JpegConstants.Markers.XFF) + { + this.markerPosition = this.stream.Position - 1; + int c = this.stream.ReadByte(); + while (c == JpegConstants.Markers.XFF) + { + c = this.stream.ReadByte(); + + if (c == -1) + { + this.eof = true; + c = 0; + break; + } + } + + if (c != 0) + { + this.marker = (byte)c; + this.nomore = true; + if (!this.HasRestart()) + { + this.badMarker = true; + } + + return; + } + } + + this.codeBuffer |= (uint)b << (24 - this.codeBits); + this.codeBits += 8; + } + while (this.codeBits <= 24); + } + + [MethodImpl(InliningOptions.ShortMethod)] + private int DecodeHuffman(ref PdfJsHuffmanTable table) + { + this.CheckBits(); + + // Look at the top FastBits and determine what symbol ID it is, + // if the code is <= FastBits. + int c = this.PeekBits(); + int k = table.Lookahead[c]; + if (k < 0xFF) + { + int s = table.Sizes[k]; + if (s > this.codeBits) + { + return -1; + } + + this.codeBuffer <<= s; + this.codeBits -= s; + return table.Values[k]; + } + + return this.DecodeHuffmanSlow(ref table); + } + + [MethodImpl(InliningOptions.ColdPath)] + private int DecodeHuffmanSlow(ref PdfJsHuffmanTable table) + { + // Naive test is to shift the code_buffer down so k bits are + // valid, then test against MaxCode. To speed this up, we've + // preshifted maxcode left so that it has (16-k) 0s at the + // end; in other words, regardless of the number of bits, it + // wants to be compared against something shifted to have 16; + // that way we don't need to shift inside the loop. + uint temp = this.codeBuffer >> 16; + int k; + for (k = FastBits + 1; ; k++) + { + if (temp < table.MaxCode[k]) + { + break; + } + } + + if (k == 17) + { + // Error! code not found + this.codeBits -= 16; + return -1; + } + + if (k > this.codeBits) + { + return -1; + } + + // Convert the huffman code to the symbol id + int c = (int)(((this.codeBuffer >> (32 - k)) & Bmask[k]) + table.ValOffset[k]); + + // Convert the id to a symbol + this.codeBits -= k; + this.codeBuffer <<= k; + return table.Values[c]; + } + + [MethodImpl(InliningOptions.ShortMethod)] + private int ExtendReceive(int n) + { + if (this.codeBits < n) + { + this.FillBuffer(); + } + + int sgn = (int)this.codeBuffer >> 31; + uint k = LRot(this.codeBuffer, n); + this.codeBuffer = k & ~Bmask[n]; + k &= Bmask[n]; + this.codeBits -= n; + return (int)(k + (Bias[n] & ~sgn)); + } + + [MethodImpl(InliningOptions.ShortMethod)] + private void CheckBits() + { + if (this.codeBits < 16) + { + this.FillBuffer(); + } + } + + [MethodImpl(InliningOptions.ShortMethod)] + private int PeekBits() => (int)((this.codeBuffer >> (32 - FastBits)) & ((1 << FastBits) - 1)); + + [MethodImpl(InliningOptions.ShortMethod)] + private bool ContinueOnMcuComplete() + { + if (--this.todo > 0) + { + return true; + } + + if (this.codeBits < 24) + { + this.FillBuffer(); + } + + // If it's NOT a restart, then just bail, so we get corrupt data rather than no data. + // Reset the stream to before any bad markers to ensure we can read sucessive segments. + if (this.badMarker) + { + this.stream.Position = this.markerPosition; + } + + if (!this.HasRestart()) + { + return false; + } + + this.Reset(); + + return true; + } + + [MethodImpl(InliningOptions.ShortMethod)] + private bool HasRestart() + { + byte m = this.marker; + return m >= JpegConstants.Markers.RST0 && m <= JpegConstants.Markers.RST7; + } + + private void Reset() + { + this.codeBits = 0; + this.codeBuffer = 0; + + for (int i = 0; i < this.components.Length; i++) + { + PdfJsFrameComponent c = this.components[i]; + c.DcPredictor = 0; + } + + this.nomore = false; + this.marker = JpegConstants.Markers.XFF; + this.markerPosition = 0; + this.badMarker = false; + this.eobrun = 0; + + // No more than 1<<31 MCUs if no restartInterval? that's plenty safe since we don't even allow 1<<30 pixels + this.todo = this.restartInterval > 0 ? this.restartInterval : int.MaxValue; + } + } +} \ No newline at end of file diff --git a/src/ImageSharp/Formats/Jpeg/PdfJsPort/PdfJsJpegDecoderCore.cs b/src/ImageSharp/Formats/Jpeg/PdfJsPort/PdfJsJpegDecoderCore.cs index 8b5b7b151..1336b8a89 100644 --- a/src/ImageSharp/Formats/Jpeg/PdfJsPort/PdfJsJpegDecoderCore.cs +++ b/src/ImageSharp/Formats/Jpeg/PdfJsPort/PdfJsJpegDecoderCore.cs @@ -58,6 +58,11 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort /// private PdfJsHuffmanTables acHuffmanTables; + /// + /// The fast AC tables used for entropy decoding + /// + private FastACTables fastACTables; + /// /// The reset interval determined by RST markers /// @@ -239,6 +244,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort this.QuantizationTables = new Block8x8F[4]; this.dcHuffmanTables = new PdfJsHuffmanTables(); this.acHuffmanTables = new PdfJsHuffmanTables(); + this.fastACTables = new FastACTables(this.configuration.MemoryAllocator); } while (fileMarker.Marker != JpegConstants.Markers.EOI) @@ -353,12 +359,14 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort { this.InputStream?.Dispose(); this.Frame?.Dispose(); + this.fastACTables?.Dispose(); // Set large fields to null. this.InputStream = null; this.Frame = null; this.dcHuffmanTables = null; this.acHuffmanTables = null; + this.fastACTables = null; } /// @@ -731,11 +739,20 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort i += 17 + codeLengthSum; + int tableType = huffmanTableSpec >> 4; + int tableIndex = huffmanTableSpec & 15; + this.BuildHuffmanTable( - huffmanTableSpec >> 4 == 0 ? this.dcHuffmanTables : this.acHuffmanTables, - huffmanTableSpec & 15, + tableType == 0 ? this.dcHuffmanTables : this.acHuffmanTables, + tableIndex, codeLengths.GetSpan(), huffmanValues.GetSpan()); + + if (huffmanTableSpec >> 4 != 0) + { + // Build a table that decodes both magnitude and value of small ACs in one go. + this.fastACTables.BuildACTableLut(huffmanTableSpec & 15, this.acHuffmanTables); + } } } } @@ -794,21 +811,22 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort int spectralStart = this.temp[0]; int spectralEnd = this.temp[1]; int successiveApproximation = this.temp[2]; - PdfJsScanDecoder scanDecoder = default; - - scanDecoder.DecodeScan( - this.Frame, - this.InputStream, - this.dcHuffmanTables, - this.acHuffmanTables, - this.Frame.Components, - componentIndex, - selectorsCount, - this.resetInterval, - spectralStart, - spectralEnd, - successiveApproximation >> 4, - successiveApproximation & 15); + + var sd = new ScanDecoder( + this.InputStream, + this.Frame, + this.dcHuffmanTables, + this.acHuffmanTables, + this.fastACTables, + componentIndex, + selectorsCount, + this.resetInterval, + spectralStart, + spectralEnd, + successiveApproximation >> 4, + successiveApproximation & 15); + + sd.ParseEntropyCodedData(); } /// @@ -835,6 +853,11 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort return BinaryPrimitives.ReadUInt16BigEndian(this.markerBuffer); } + /// + /// Post processes the pixels into the destination image. + /// + /// The pixel format. + /// The . private Image PostProcessIntoImage() where TPixel : struct, IPixel { diff --git a/src/ImageSharp/Formats/Png/IPngEncoderOptions.cs b/src/ImageSharp/Formats/Png/IPngEncoderOptions.cs index 3b8aea669..f3231fa22 100644 --- a/src/ImageSharp/Formats/Png/IPngEncoderOptions.cs +++ b/src/ImageSharp/Formats/Png/IPngEncoderOptions.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using SixLabors.ImageSharp.Processing.Quantization; +using SixLabors.ImageSharp.Processing.Processors.Quantization; namespace SixLabors.ImageSharp.Formats.Png { diff --git a/src/ImageSharp/Formats/Png/PngEncoder.cs b/src/ImageSharp/Formats/Png/PngEncoder.cs index babda2eff..109e6ad77 100644 --- a/src/ImageSharp/Formats/Png/PngEncoder.cs +++ b/src/ImageSharp/Formats/Png/PngEncoder.cs @@ -4,7 +4,7 @@ using System.IO; using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Quantization; +using SixLabors.ImageSharp.Processing.Processors.Quantization; namespace SixLabors.ImageSharp.Formats.Png { diff --git a/src/ImageSharp/Formats/Png/PngEncoderCore.cs b/src/ImageSharp/Formats/Png/PngEncoderCore.cs index ceb2d6e12..9e4b516a1 100644 --- a/src/ImageSharp/Formats/Png/PngEncoderCore.cs +++ b/src/ImageSharp/Formats/Png/PngEncoderCore.cs @@ -9,7 +9,7 @@ using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.Formats.Png.Filters; using SixLabors.ImageSharp.Formats.Png.Zlib; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Quantization; +using SixLabors.ImageSharp.Processing.Processors.Quantization; using SixLabors.Memory; namespace SixLabors.ImageSharp.Formats.Png diff --git a/src/ImageSharp/MetaData/Profiles/ICC/IccProfile.cs b/src/ImageSharp/MetaData/Profiles/ICC/IccProfile.cs index 52b8e43da..db1d96d7e 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/IccProfile.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/IccProfile.cs @@ -167,11 +167,22 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc /// True if the profile is valid; False otherwise public bool CheckIsValid() { - return Enum.IsDefined(typeof(IccColorSpaceType), this.Header.DataColorSpace) && + const int minSize = 128; + const int maxSize = 50_000_000; // it's unlikely there is a profile bigger than 50MB + + bool arrayValid = true; + if (this.data != null) + { + arrayValid = this.data.Length >= minSize && + this.data.Length >= this.Header.Size; + } + + return arrayValid && + Enum.IsDefined(typeof(IccColorSpaceType), this.Header.DataColorSpace) && Enum.IsDefined(typeof(IccColorSpaceType), this.Header.ProfileConnectionSpace) && Enum.IsDefined(typeof(IccRenderingIntent), this.Header.RenderingIntent) && - this.Header.Size >= 128 && - this.Header.Size < 50_000_000; // it's unlikely there is a profile bigger than 50MB + this.Header.Size >= minSize && + this.Header.Size < maxSize; } /// diff --git a/src/ImageSharp/Processing/Transforms/AnchorPositionMode.cs b/src/ImageSharp/Processing/AnchorPositionMode.cs similarity index 96% rename from src/ImageSharp/Processing/Transforms/AnchorPositionMode.cs rename to src/ImageSharp/Processing/AnchorPositionMode.cs index 793fc0dfc..ef9c0fdaf 100644 --- a/src/ImageSharp/Processing/Transforms/AnchorPositionMode.cs +++ b/src/ImageSharp/Processing/AnchorPositionMode.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing.Transforms +namespace SixLabors.ImageSharp.Processing { /// /// Enumerated anchor positions to apply to resized images. diff --git a/src/ImageSharp/Processing/Transforms/AutoOrientExtensions.cs b/src/ImageSharp/Processing/AutoOrientExtensions.cs similarity index 89% rename from src/ImageSharp/Processing/Transforms/AutoOrientExtensions.cs rename to src/ImageSharp/Processing/AutoOrientExtensions.cs index d3ac16708..d11fc9623 100644 --- a/src/ImageSharp/Processing/Transforms/AutoOrientExtensions.cs +++ b/src/ImageSharp/Processing/AutoOrientExtensions.cs @@ -2,9 +2,9 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Transforms.Processors; +using SixLabors.ImageSharp.Processing.Processors.Transforms; -namespace SixLabors.ImageSharp.Processing.Transforms +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the application of auto-orientation operations to the type. diff --git a/src/ImageSharp/Processing/Overlays/BackgroundColorExtensions.cs b/src/ImageSharp/Processing/BackgroundColorExtensions.cs similarity index 97% rename from src/ImageSharp/Processing/Overlays/BackgroundColorExtensions.cs rename to src/ImageSharp/Processing/BackgroundColorExtensions.cs index 1a8224769..1ad2c9237 100644 --- a/src/ImageSharp/Processing/Overlays/BackgroundColorExtensions.cs +++ b/src/ImageSharp/Processing/BackgroundColorExtensions.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Overlays.Processors; +using SixLabors.ImageSharp.Processing.Processors.Overlays; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Overlays +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the application of a background color to the type. diff --git a/src/ImageSharp/Processing/Binarization/BinaryDiffuseExtensions.cs b/src/ImageSharp/Processing/BinaryDiffuseExtensions.cs similarity index 96% rename from src/ImageSharp/Processing/Binarization/BinaryDiffuseExtensions.cs rename to src/ImageSharp/Processing/BinaryDiffuseExtensions.cs index a2859b011..788942dde 100644 --- a/src/ImageSharp/Processing/Binarization/BinaryDiffuseExtensions.cs +++ b/src/ImageSharp/Processing/BinaryDiffuseExtensions.cs @@ -2,11 +2,11 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Binarization.Processors; -using SixLabors.ImageSharp.Processing.Dithering.ErrorDiffusion; +using SixLabors.ImageSharp.Processing.Processors.Binarization; +using SixLabors.ImageSharp.Processing.Processors.Dithering; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Binarization +namespace SixLabors.ImageSharp.Processing { /// /// Adds binary diffusion extensions to the type. diff --git a/src/ImageSharp/Processing/Binarization/BinaryDitherExtensions.cs b/src/ImageSharp/Processing/BinaryDitherExtensions.cs similarity index 95% rename from src/ImageSharp/Processing/Binarization/BinaryDitherExtensions.cs rename to src/ImageSharp/Processing/BinaryDitherExtensions.cs index e66be55de..617770196 100644 --- a/src/ImageSharp/Processing/Binarization/BinaryDitherExtensions.cs +++ b/src/ImageSharp/Processing/BinaryDitherExtensions.cs @@ -2,11 +2,11 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Binarization.Processors; -using SixLabors.ImageSharp.Processing.Dithering.Ordered; +using SixLabors.ImageSharp.Processing.Processors.Binarization; +using SixLabors.ImageSharp.Processing.Processors.Dithering; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Binarization +namespace SixLabors.ImageSharp.Processing { /// /// Adds binary dithering extensions to the type. diff --git a/src/ImageSharp/Processing/Binarization/BinaryThresholdExtensions.cs b/src/ImageSharp/Processing/BinaryThresholdExtensions.cs similarity index 97% rename from src/ImageSharp/Processing/Binarization/BinaryThresholdExtensions.cs rename to src/ImageSharp/Processing/BinaryThresholdExtensions.cs index 005061394..31f81ba4b 100644 --- a/src/ImageSharp/Processing/Binarization/BinaryThresholdExtensions.cs +++ b/src/ImageSharp/Processing/BinaryThresholdExtensions.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Binarization.Processors; +using SixLabors.ImageSharp.Processing.Processors.Binarization; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Binarization +namespace SixLabors.ImageSharp.Processing { /// /// Adds binary thresholding extensions to the type. diff --git a/src/ImageSharp/Processing/Filters/BlackWhiteExtensions.cs b/src/ImageSharp/Processing/BlackWhiteExtensions.cs similarity index 93% rename from src/ImageSharp/Processing/Filters/BlackWhiteExtensions.cs rename to src/ImageSharp/Processing/BlackWhiteExtensions.cs index f30cefb86..0484fa84e 100644 --- a/src/ImageSharp/Processing/Filters/BlackWhiteExtensions.cs +++ b/src/ImageSharp/Processing/BlackWhiteExtensions.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Filters.Processors; +using SixLabors.ImageSharp.Processing.Processors.Filters; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Filters +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the application of black and white toning to the type. diff --git a/src/ImageSharp/Processing/Convolution/BoxBlurExtensions.cs b/src/ImageSharp/Processing/BoxBlurExtensions.cs similarity index 95% rename from src/ImageSharp/Processing/Convolution/BoxBlurExtensions.cs rename to src/ImageSharp/Processing/BoxBlurExtensions.cs index edb798fb4..624da239b 100644 --- a/src/ImageSharp/Processing/Convolution/BoxBlurExtensions.cs +++ b/src/ImageSharp/Processing/BoxBlurExtensions.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Convolution.Processors; +using SixLabors.ImageSharp.Processing.Processors.Convolution; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Convolution +namespace SixLabors.ImageSharp.Processing { /// /// Adds box blurring extensions to the type. diff --git a/src/ImageSharp/Processing/Filters/BrightnessExtensions.cs b/src/ImageSharp/Processing/BrightnessExtensions.cs similarity index 95% rename from src/ImageSharp/Processing/Filters/BrightnessExtensions.cs rename to src/ImageSharp/Processing/BrightnessExtensions.cs index a36d588d5..2f252ad30 100644 --- a/src/ImageSharp/Processing/Filters/BrightnessExtensions.cs +++ b/src/ImageSharp/Processing/BrightnessExtensions.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Filters.Processors; +using SixLabors.ImageSharp.Processing.Processors.Filters; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Filters +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the alteration of the brightness component to the type. diff --git a/src/ImageSharp/Processing/Filters/ColorBlindnessExtensions.cs b/src/ImageSharp/Processing/ColorBlindnessExtensions.cs similarity index 96% rename from src/ImageSharp/Processing/Filters/ColorBlindnessExtensions.cs rename to src/ImageSharp/Processing/ColorBlindnessExtensions.cs index d70064097..331635895 100644 --- a/src/ImageSharp/Processing/Filters/ColorBlindnessExtensions.cs +++ b/src/ImageSharp/Processing/ColorBlindnessExtensions.cs @@ -2,11 +2,11 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Filters.Processors; using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.ImageSharp.Processing.Processors.Filters; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Filters +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that simulate the effects of various color blindness disorders to the type. diff --git a/src/ImageSharp/Processing/Filters/ColorBlindnessMode.cs b/src/ImageSharp/Processing/ColorBlindnessMode.cs similarity index 95% rename from src/ImageSharp/Processing/Filters/ColorBlindnessMode.cs rename to src/ImageSharp/Processing/ColorBlindnessMode.cs index 584c9fa08..2ff19e77e 100644 --- a/src/ImageSharp/Processing/Filters/ColorBlindnessMode.cs +++ b/src/ImageSharp/Processing/ColorBlindnessMode.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing.Filters +namespace SixLabors.ImageSharp.Processing { /// /// Enumerates the various types of defined color blindness filters. diff --git a/src/ImageSharp/Processing/Filters/ContrastExtensions.cs b/src/ImageSharp/Processing/ContrastExtensions.cs similarity index 95% rename from src/ImageSharp/Processing/Filters/ContrastExtensions.cs rename to src/ImageSharp/Processing/ContrastExtensions.cs index 16225039c..776aa6751 100644 --- a/src/ImageSharp/Processing/Filters/ContrastExtensions.cs +++ b/src/ImageSharp/Processing/ContrastExtensions.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Filters.Processors; +using SixLabors.ImageSharp.Processing.Processors.Filters; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Filters +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the alteration of the contrast component to the type. diff --git a/src/ImageSharp/Processing/Transforms/CropExtensions.cs b/src/ImageSharp/Processing/CropExtensions.cs similarity index 93% rename from src/ImageSharp/Processing/Transforms/CropExtensions.cs rename to src/ImageSharp/Processing/CropExtensions.cs index 9e347f51c..34c754a08 100644 --- a/src/ImageSharp/Processing/Transforms/CropExtensions.cs +++ b/src/ImageSharp/Processing/CropExtensions.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Transforms.Processors; +using SixLabors.ImageSharp.Processing.Processors.Transforms; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Transforms +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the application of cropping operations to the type. diff --git a/src/ImageSharp/Processing/Convolution/DetectEdgesExtensions.cs b/src/ImageSharp/Processing/DetectEdgesExtensions.cs similarity index 98% rename from src/ImageSharp/Processing/Convolution/DetectEdgesExtensions.cs rename to src/ImageSharp/Processing/DetectEdgesExtensions.cs index a2b2b244b..5ac89df29 100644 --- a/src/ImageSharp/Processing/Convolution/DetectEdgesExtensions.cs +++ b/src/ImageSharp/Processing/DetectEdgesExtensions.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Convolution.Processors; +using SixLabors.ImageSharp.Processing.Processors.Convolution; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Convolution +namespace SixLabors.ImageSharp.Processing { /// /// Adds edge detection extensions to the type. diff --git a/src/ImageSharp/Processing/Dithering/DiffuseExtensions.cs b/src/ImageSharp/Processing/DiffuseExtensions.cs similarity index 97% rename from src/ImageSharp/Processing/Dithering/DiffuseExtensions.cs rename to src/ImageSharp/Processing/DiffuseExtensions.cs index adb678ee4..768d28116 100644 --- a/src/ImageSharp/Processing/Dithering/DiffuseExtensions.cs +++ b/src/ImageSharp/Processing/DiffuseExtensions.cs @@ -2,8 +2,7 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Dithering.ErrorDiffusion; -using SixLabors.ImageSharp.Processing.Dithering.Processors; +using SixLabors.ImageSharp.Processing.Processors.Dithering; using SixLabors.Primitives; namespace SixLabors.ImageSharp.Processing.Dithering diff --git a/src/ImageSharp/Processing/Dithering/DitherExtensions.cs b/src/ImageSharp/Processing/DitherExtensions.cs similarity index 96% rename from src/ImageSharp/Processing/Dithering/DitherExtensions.cs rename to src/ImageSharp/Processing/DitherExtensions.cs index 48dd87a3b..795561e70 100644 --- a/src/ImageSharp/Processing/Dithering/DitherExtensions.cs +++ b/src/ImageSharp/Processing/DitherExtensions.cs @@ -2,11 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Dithering.Ordered; -using SixLabors.ImageSharp.Processing.Dithering.Processors; +using SixLabors.ImageSharp.Processing.Processors.Dithering; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Dithering +namespace SixLabors.ImageSharp.Processing { /// /// Adds dithering extensions to the type. diff --git a/src/ImageSharp/Processing/Convolution/EdgeDetectionOperators.cs b/src/ImageSharp/Processing/EdgeDetectionOperators.cs similarity index 96% rename from src/ImageSharp/Processing/Convolution/EdgeDetectionOperators.cs rename to src/ImageSharp/Processing/EdgeDetectionOperators.cs index 55cbbeaf7..1f3526760 100644 --- a/src/ImageSharp/Processing/Convolution/EdgeDetectionOperators.cs +++ b/src/ImageSharp/Processing/EdgeDetectionOperators.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing.Convolution +namespace SixLabors.ImageSharp.Processing { /// /// Enumerates the various types of defined edge detection filters. diff --git a/src/ImageSharp/Processing/Transforms/EntropyCropExtensions.cs b/src/ImageSharp/Processing/EntropyCropExtensions.cs similarity index 93% rename from src/ImageSharp/Processing/Transforms/EntropyCropExtensions.cs rename to src/ImageSharp/Processing/EntropyCropExtensions.cs index 3ca4c72bc..157e69ef2 100644 --- a/src/ImageSharp/Processing/Transforms/EntropyCropExtensions.cs +++ b/src/ImageSharp/Processing/EntropyCropExtensions.cs @@ -2,9 +2,9 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Transforms.Processors; +using SixLabors.ImageSharp.Processing.Processors.Transforms; -namespace SixLabors.ImageSharp.Processing.Transforms +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the application of entropy cropping operations to the type. diff --git a/src/ImageSharp/Processing/Filters/FilterExtensions.cs b/src/ImageSharp/Processing/FilterExtensions.cs similarity index 94% rename from src/ImageSharp/Processing/Filters/FilterExtensions.cs rename to src/ImageSharp/Processing/FilterExtensions.cs index ae8bbda03..bfae4ae65 100644 --- a/src/ImageSharp/Processing/Filters/FilterExtensions.cs +++ b/src/ImageSharp/Processing/FilterExtensions.cs @@ -3,10 +3,10 @@ using System.Numerics; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Filters.Processors; +using SixLabors.ImageSharp.Processing.Processors.Filters; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Filters +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the application of composable filters to the type. diff --git a/src/ImageSharp/Processing/Transforms/FlipExtensions.cs b/src/ImageSharp/Processing/FlipExtensions.cs similarity index 89% rename from src/ImageSharp/Processing/Transforms/FlipExtensions.cs rename to src/ImageSharp/Processing/FlipExtensions.cs index 0cbbdd95f..dfbff7e4d 100644 --- a/src/ImageSharp/Processing/Transforms/FlipExtensions.cs +++ b/src/ImageSharp/Processing/FlipExtensions.cs @@ -2,9 +2,9 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Transforms.Processors; +using SixLabors.ImageSharp.Processing.Processors.Transforms; -namespace SixLabors.ImageSharp.Processing.Transforms +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the application of flipping operations to the type. diff --git a/src/ImageSharp/Processing/Transforms/FlipMode.cs b/src/ImageSharp/Processing/FlipMode.cs similarity index 90% rename from src/ImageSharp/Processing/Transforms/FlipMode.cs rename to src/ImageSharp/Processing/FlipMode.cs index 32c910c80..96cd38de4 100644 --- a/src/ImageSharp/Processing/Transforms/FlipMode.cs +++ b/src/ImageSharp/Processing/FlipMode.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing.Transforms +namespace SixLabors.ImageSharp.Processing { /// /// Provides enumeration over how a image should be flipped. diff --git a/src/ImageSharp/Processing/Convolution/GaussianBlurExtensions.cs b/src/ImageSharp/Processing/GaussianBlurExtensions.cs similarity index 95% rename from src/ImageSharp/Processing/Convolution/GaussianBlurExtensions.cs rename to src/ImageSharp/Processing/GaussianBlurExtensions.cs index ae3eace64..165c4ce1a 100644 --- a/src/ImageSharp/Processing/Convolution/GaussianBlurExtensions.cs +++ b/src/ImageSharp/Processing/GaussianBlurExtensions.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Convolution.Processors; +using SixLabors.ImageSharp.Processing.Processors.Convolution; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Convolution +namespace SixLabors.ImageSharp.Processing { /// /// Adds Gaussian blurring extensions to the type. diff --git a/src/ImageSharp/Processing/Convolution/GaussianSharpenExtensions.cs b/src/ImageSharp/Processing/GaussianSharpenExtensions.cs similarity index 95% rename from src/ImageSharp/Processing/Convolution/GaussianSharpenExtensions.cs rename to src/ImageSharp/Processing/GaussianSharpenExtensions.cs index 334a02b79..675bbc142 100644 --- a/src/ImageSharp/Processing/Convolution/GaussianSharpenExtensions.cs +++ b/src/ImageSharp/Processing/GaussianSharpenExtensions.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Convolution.Processors; +using SixLabors.ImageSharp.Processing.Processors.Convolution; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Convolution +namespace SixLabors.ImageSharp.Processing { /// /// Adds Gaussian sharpening extensions to the type. diff --git a/src/ImageSharp/Processing/Overlays/GlowExtensions.cs b/src/ImageSharp/Processing/GlowExtensions.cs similarity index 98% rename from src/ImageSharp/Processing/Overlays/GlowExtensions.cs rename to src/ImageSharp/Processing/GlowExtensions.cs index 54af9f274..8b6e8ffc2 100644 --- a/src/ImageSharp/Processing/Overlays/GlowExtensions.cs +++ b/src/ImageSharp/Processing/GlowExtensions.cs @@ -3,10 +3,10 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Primitives; -using SixLabors.ImageSharp.Processing.Overlays.Processors; +using SixLabors.ImageSharp.Processing.Processors.Overlays; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Overlays +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the application of a radial glow to the type. diff --git a/src/ImageSharp/Processing/Filters/GrayscaleExtensions.cs b/src/ImageSharp/Processing/GrayscaleExtensions.cs similarity index 98% rename from src/ImageSharp/Processing/Filters/GrayscaleExtensions.cs rename to src/ImageSharp/Processing/GrayscaleExtensions.cs index 34ee4d0f3..9ab664056 100644 --- a/src/ImageSharp/Processing/Filters/GrayscaleExtensions.cs +++ b/src/ImageSharp/Processing/GrayscaleExtensions.cs @@ -2,11 +2,11 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Filters.Processors; using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.ImageSharp.Processing.Processors.Filters; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Filters +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the application of grayscale toning to the type. diff --git a/src/ImageSharp/Processing/Filters/GrayscaleMode.cs b/src/ImageSharp/Processing/GrayscaleMode.cs similarity index 89% rename from src/ImageSharp/Processing/Filters/GrayscaleMode.cs rename to src/ImageSharp/Processing/GrayscaleMode.cs index db30e67ff..e42a2e633 100644 --- a/src/ImageSharp/Processing/Filters/GrayscaleMode.cs +++ b/src/ImageSharp/Processing/GrayscaleMode.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing.Filters +namespace SixLabors.ImageSharp.Processing { /// /// Enumerates the various types of defined grayscale filters. diff --git a/src/ImageSharp/Processing/Filters/HueExtensions.cs b/src/ImageSharp/Processing/HueExtensions.cs similarity index 94% rename from src/ImageSharp/Processing/Filters/HueExtensions.cs rename to src/ImageSharp/Processing/HueExtensions.cs index 1b730d7f0..246d4bf2b 100644 --- a/src/ImageSharp/Processing/Filters/HueExtensions.cs +++ b/src/ImageSharp/Processing/HueExtensions.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Filters.Processors; +using SixLabors.ImageSharp.Processing.Processors.Filters; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Filters +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the alteration of the hue component to the type. diff --git a/src/ImageSharp/Processing/Filters/InvertExtensions.cs b/src/ImageSharp/Processing/InvertExtensions.cs similarity index 93% rename from src/ImageSharp/Processing/Filters/InvertExtensions.cs rename to src/ImageSharp/Processing/InvertExtensions.cs index 784b37c56..9e031bc95 100644 --- a/src/ImageSharp/Processing/Filters/InvertExtensions.cs +++ b/src/ImageSharp/Processing/InvertExtensions.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Filters.Processors; +using SixLabors.ImageSharp.Processing.Processors.Filters; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Filters +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the inversion of colors to the type. diff --git a/src/ImageSharp/Processing/Dithering/KnownDiffusers.cs b/src/ImageSharp/Processing/KnownDiffusers.cs similarity index 94% rename from src/ImageSharp/Processing/Dithering/KnownDiffusers.cs rename to src/ImageSharp/Processing/KnownDiffusers.cs index 250a543ec..2b10312fe 100644 --- a/src/ImageSharp/Processing/Dithering/KnownDiffusers.cs +++ b/src/ImageSharp/Processing/KnownDiffusers.cs @@ -1,9 +1,9 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using SixLabors.ImageSharp.Processing.Dithering.ErrorDiffusion; +using SixLabors.ImageSharp.Processing.Processors.Dithering; -namespace SixLabors.ImageSharp.Processing.Dithering +namespace SixLabors.ImageSharp.Processing { /// /// Contains reusable static instances of known error diffusion algorithms diff --git a/src/ImageSharp/Processing/Dithering/KnownDitherers.cs b/src/ImageSharp/Processing/KnownDitherers.cs similarity index 88% rename from src/ImageSharp/Processing/Dithering/KnownDitherers.cs rename to src/ImageSharp/Processing/KnownDitherers.cs index b268ae12c..dad5bb38c 100644 --- a/src/ImageSharp/Processing/Dithering/KnownDitherers.cs +++ b/src/ImageSharp/Processing/KnownDitherers.cs @@ -1,14 +1,14 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using SixLabors.ImageSharp.Processing.Dithering.Ordered; +using SixLabors.ImageSharp.Processing.Processors.Dithering; -namespace SixLabors.ImageSharp.Processing.Dithering +namespace SixLabors.ImageSharp.Processing { /// /// Contains reusable static instances of known ordered dither matrices /// - public class KnownDitherers + public static class KnownDitherers { /// /// Gets the order ditherer using the 2x2 Bayer dithering matrix diff --git a/src/ImageSharp/Processing/Filters/KnownFilterMatrices.cs b/src/ImageSharp/Processing/KnownFilterMatrices.cs similarity index 99% rename from src/ImageSharp/Processing/Filters/KnownFilterMatrices.cs rename to src/ImageSharp/Processing/KnownFilterMatrices.cs index 9da4aaa65..4f5e3c869 100644 --- a/src/ImageSharp/Processing/Filters/KnownFilterMatrices.cs +++ b/src/ImageSharp/Processing/KnownFilterMatrices.cs @@ -4,7 +4,7 @@ using System; using System.Numerics; -namespace SixLabors.ImageSharp.Processing.Filters +namespace SixLabors.ImageSharp.Processing { /// /// A collection of known values for composing filters @@ -314,7 +314,7 @@ namespace SixLabors.ImageSharp.Processing.Filters public static Matrix4x4 CreateHueFilter(float degrees) { // Wrap the angle round at 360. - degrees = degrees % 360; + degrees %= 360; // Make sure it's not negative. while (degrees < 0) diff --git a/src/ImageSharp/Processing/Quantization/KnownQuantizers.cs b/src/ImageSharp/Processing/KnownQuantizers.cs similarity index 90% rename from src/ImageSharp/Processing/Quantization/KnownQuantizers.cs rename to src/ImageSharp/Processing/KnownQuantizers.cs index 357cd5676..fe9806310 100644 --- a/src/ImageSharp/Processing/Quantization/KnownQuantizers.cs +++ b/src/ImageSharp/Processing/KnownQuantizers.cs @@ -1,7 +1,9 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing.Quantization +using SixLabors.ImageSharp.Processing.Processors.Quantization; + +namespace SixLabors.ImageSharp.Processing { /// /// Contains reusable static instances of known quantizing algorithms diff --git a/src/ImageSharp/Processing/Transforms/KnownResamplers.cs b/src/ImageSharp/Processing/KnownResamplers.cs similarity index 97% rename from src/ImageSharp/Processing/Transforms/KnownResamplers.cs rename to src/ImageSharp/Processing/KnownResamplers.cs index 2b589d461..70a413ec0 100644 --- a/src/ImageSharp/Processing/Transforms/KnownResamplers.cs +++ b/src/ImageSharp/Processing/KnownResamplers.cs @@ -1,9 +1,9 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using SixLabors.ImageSharp.Processing.Transforms.Resamplers; +using SixLabors.ImageSharp.Processing.Processors.Transforms; -namespace SixLabors.ImageSharp.Processing.Transforms +namespace SixLabors.ImageSharp.Processing { /// /// Contains reusable static instances of known resampling algorithms diff --git a/src/ImageSharp/Processing/Filters/KodachromeExtensions.cs b/src/ImageSharp/Processing/KodachromeExtensions.cs similarity index 94% rename from src/ImageSharp/Processing/Filters/KodachromeExtensions.cs rename to src/ImageSharp/Processing/KodachromeExtensions.cs index 94f1acc0c..e438b131e 100644 --- a/src/ImageSharp/Processing/Filters/KodachromeExtensions.cs +++ b/src/ImageSharp/Processing/KodachromeExtensions.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Filters.Processors; +using SixLabors.ImageSharp.Processing.Processors.Filters; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Filters +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the recreation of an old Kodachrome camera effect to the type. diff --git a/src/ImageSharp/Processing/Filters/LomographExtensions.cs b/src/ImageSharp/Processing/LomographExtensions.cs similarity index 94% rename from src/ImageSharp/Processing/Filters/LomographExtensions.cs rename to src/ImageSharp/Processing/LomographExtensions.cs index ed9e1cc29..7dff16402 100644 --- a/src/ImageSharp/Processing/Filters/LomographExtensions.cs +++ b/src/ImageSharp/Processing/LomographExtensions.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Filters.Processors; +using SixLabors.ImageSharp.Processing.Processors.Filters; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Filters +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the recreation of an old Lomograph camera effect to the type. diff --git a/src/ImageSharp/Processing/Effects/OilPaintExtensions.cs b/src/ImageSharp/Processing/OilPaintExtensions.cs similarity index 97% rename from src/ImageSharp/Processing/Effects/OilPaintExtensions.cs rename to src/ImageSharp/Processing/OilPaintExtensions.cs index a04bbec4e..b6fa4149a 100644 --- a/src/ImageSharp/Processing/Effects/OilPaintExtensions.cs +++ b/src/ImageSharp/Processing/OilPaintExtensions.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Effects.Processors; +using SixLabors.ImageSharp.Processing.Processors.Effects; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Effects +namespace SixLabors.ImageSharp.Processing { /// /// Adds oil painting effect extensions to the type. diff --git a/src/ImageSharp/Processing/Filters/OpacityExtensions.cs b/src/ImageSharp/Processing/OpacityExtensions.cs similarity index 94% rename from src/ImageSharp/Processing/Filters/OpacityExtensions.cs rename to src/ImageSharp/Processing/OpacityExtensions.cs index e263fef4e..fc3fd331d 100644 --- a/src/ImageSharp/Processing/Filters/OpacityExtensions.cs +++ b/src/ImageSharp/Processing/OpacityExtensions.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Filters.Processors; +using SixLabors.ImageSharp.Processing.Processors.Filters; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Filters +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the alteration of the opacity component to the type. diff --git a/src/ImageSharp/Processing/Transforms/OrientationMode.cs b/src/ImageSharp/Processing/OrientationMode.cs similarity index 96% rename from src/ImageSharp/Processing/Transforms/OrientationMode.cs rename to src/ImageSharp/Processing/OrientationMode.cs index c6f05380b..ba55425b8 100644 --- a/src/ImageSharp/Processing/Transforms/OrientationMode.cs +++ b/src/ImageSharp/Processing/OrientationMode.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing.Transforms +namespace SixLabors.ImageSharp.Processing { /// /// Enumerates the available orientation values supplied by EXIF metadata. diff --git a/src/ImageSharp/Processing/Transforms/PadExtensions.cs b/src/ImageSharp/Processing/PadExtensions.cs similarity index 95% rename from src/ImageSharp/Processing/Transforms/PadExtensions.cs rename to src/ImageSharp/Processing/PadExtensions.cs index a231088dd..f73033968 100644 --- a/src/ImageSharp/Processing/Transforms/PadExtensions.cs +++ b/src/ImageSharp/Processing/PadExtensions.cs @@ -4,7 +4,7 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Transforms +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the application of padding operations to the type. diff --git a/src/ImageSharp/Processing/Effects/PixelateExtensions.cs b/src/ImageSharp/Processing/PixelateExtensions.cs similarity index 95% rename from src/ImageSharp/Processing/Effects/PixelateExtensions.cs rename to src/ImageSharp/Processing/PixelateExtensions.cs index d6fcfe6f1..4507f6392 100644 --- a/src/ImageSharp/Processing/Effects/PixelateExtensions.cs +++ b/src/ImageSharp/Processing/PixelateExtensions.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Effects.Processors; +using SixLabors.ImageSharp.Processing.Processors.Effects; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Effects +namespace SixLabors.ImageSharp.Processing { /// /// Adds pixelation effect extensions to the type. diff --git a/src/ImageSharp/Processing/Filters/PolaroidExtensions.cs b/src/ImageSharp/Processing/PolaroidExtensions.cs similarity index 94% rename from src/ImageSharp/Processing/Filters/PolaroidExtensions.cs rename to src/ImageSharp/Processing/PolaroidExtensions.cs index 37f06f9cf..5d4beee22 100644 --- a/src/ImageSharp/Processing/Filters/PolaroidExtensions.cs +++ b/src/ImageSharp/Processing/PolaroidExtensions.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Filters.Processors; +using SixLabors.ImageSharp.Processing.Processors.Filters; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Filters +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the recreation of an old Polaroid camera effect to the type. diff --git a/src/ImageSharp/Processing/Binarization/Processors/BinaryErrorDiffusionProcessor.cs b/src/ImageSharp/Processing/Processors/Binarization/BinaryErrorDiffusionProcessor.cs similarity index 96% rename from src/ImageSharp/Processing/Binarization/Processors/BinaryErrorDiffusionProcessor.cs rename to src/ImageSharp/Processing/Processors/Binarization/BinaryErrorDiffusionProcessor.cs index 64763b657..5041dcf5a 100644 --- a/src/ImageSharp/Processing/Binarization/Processors/BinaryErrorDiffusionProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Binarization/BinaryErrorDiffusionProcessor.cs @@ -4,11 +4,10 @@ using System; using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Dithering.ErrorDiffusion; -using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.ImageSharp.Processing.Processors.Dithering; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Binarization.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Binarization { /// /// Performs binary threshold filtering against an image using error diffusion. diff --git a/src/ImageSharp/Processing/Binarization/Processors/BinaryOrderedDitherProcessor.cs b/src/ImageSharp/Processing/Processors/Binarization/BinaryOrderedDitherProcessor.cs similarity index 95% rename from src/ImageSharp/Processing/Binarization/Processors/BinaryOrderedDitherProcessor.cs rename to src/ImageSharp/Processing/Processors/Binarization/BinaryOrderedDitherProcessor.cs index 3fe56ff44..95f4ef472 100644 --- a/src/ImageSharp/Processing/Binarization/Processors/BinaryOrderedDitherProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Binarization/BinaryOrderedDitherProcessor.cs @@ -4,11 +4,10 @@ using System; using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Dithering.Ordered; -using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.ImageSharp.Processing.Processors.Dithering; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Binarization.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Binarization { /// /// Performs binary threshold filtering against an image using ordered dithering. diff --git a/src/ImageSharp/Processing/Binarization/Processors/BinaryThresholdProcessor.cs b/src/ImageSharp/Processing/Processors/Binarization/BinaryThresholdProcessor.cs similarity index 98% rename from src/ImageSharp/Processing/Binarization/Processors/BinaryThresholdProcessor.cs rename to src/ImageSharp/Processing/Processors/Binarization/BinaryThresholdProcessor.cs index dc1297d6f..57d4e00ae 100644 --- a/src/ImageSharp/Processing/Binarization/Processors/BinaryThresholdProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Binarization/BinaryThresholdProcessor.cs @@ -8,7 +8,7 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing.Processors; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Binarization.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Binarization { /// /// Performs simple binary threshold filtering against an image. diff --git a/src/ImageSharp/Processing/Convolution/Processors/BoxBlurProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/BoxBlurProcessor.cs similarity index 96% rename from src/ImageSharp/Processing/Convolution/Processors/BoxBlurProcessor.cs rename to src/ImageSharp/Processing/Processors/Convolution/BoxBlurProcessor.cs index 886fb5d75..0ec62ac3d 100644 --- a/src/ImageSharp/Processing/Convolution/Processors/BoxBlurProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/BoxBlurProcessor.cs @@ -3,10 +3,9 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Primitives; -using SixLabors.ImageSharp.Processing.Processors; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Convolution.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Convolution { /// /// Applies box blur processing to the image. diff --git a/src/ImageSharp/Processing/Convolution/Processors/Convolution2DProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/Convolution2DProcessor.cs similarity index 97% rename from src/ImageSharp/Processing/Convolution/Processors/Convolution2DProcessor.cs rename to src/ImageSharp/Processing/Processors/Convolution/Convolution2DProcessor.cs index 48503e999..57f71a9ce 100644 --- a/src/ImageSharp/Processing/Convolution/Processors/Convolution2DProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/Convolution2DProcessor.cs @@ -7,11 +7,10 @@ using System.Threading.Tasks; using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Primitives; -using SixLabors.ImageSharp.Processing.Processors; using SixLabors.Memory; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Convolution.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Convolution { /// /// Defines a processor that uses two one-dimensional matrices to perform convolution against an image. diff --git a/src/ImageSharp/Processing/Convolution/Processors/Convolution2PassProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/Convolution2PassProcessor.cs similarity index 98% rename from src/ImageSharp/Processing/Convolution/Processors/Convolution2PassProcessor.cs rename to src/ImageSharp/Processing/Processors/Convolution/Convolution2PassProcessor.cs index 4e14882ff..6d7147cf7 100644 --- a/src/ImageSharp/Processing/Convolution/Processors/Convolution2PassProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/Convolution2PassProcessor.cs @@ -10,7 +10,7 @@ using SixLabors.ImageSharp.Processing.Processors; using SixLabors.Memory; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Convolution.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Convolution { /// /// Defines a processor that uses two one-dimensional matrices to perform two-pass convolution against an image. diff --git a/src/ImageSharp/Processing/Convolution/Processors/ConvolutionProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/ConvolutionProcessor.cs similarity index 98% rename from src/ImageSharp/Processing/Convolution/Processors/ConvolutionProcessor.cs rename to src/ImageSharp/Processing/Processors/Convolution/ConvolutionProcessor.cs index 221cf19ec..84a166545 100644 --- a/src/ImageSharp/Processing/Convolution/Processors/ConvolutionProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/ConvolutionProcessor.cs @@ -11,7 +11,7 @@ using SixLabors.ImageSharp.Processing.Processors; using SixLabors.Memory; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Convolution.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Convolution { /// /// Defines a processor that uses a 2 dimensional matrix to perform convolution against an image. diff --git a/src/ImageSharp/Processing/Convolution/Processors/EdgeDetector2DProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetector2DProcessor.cs similarity index 92% rename from src/ImageSharp/Processing/Convolution/Processors/EdgeDetector2DProcessor.cs rename to src/ImageSharp/Processing/Processors/Convolution/EdgeDetector2DProcessor.cs index c3530647a..dd43d3e15 100644 --- a/src/ImageSharp/Processing/Convolution/Processors/EdgeDetector2DProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetector2DProcessor.cs @@ -3,11 +3,10 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Primitives; -using SixLabors.ImageSharp.Processing.Filters.Processors; -using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.ImageSharp.Processing.Processors.Filters; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Convolution.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Convolution { /// /// Defines a processor that detects edges within an image using two one-dimensional matrices. diff --git a/src/ImageSharp/Processing/Convolution/Processors/EdgeDetectorCompassProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetectorCompassProcessor.cs similarity index 97% rename from src/ImageSharp/Processing/Convolution/Processors/EdgeDetectorCompassProcessor.cs rename to src/ImageSharp/Processing/Processors/Convolution/EdgeDetectorCompassProcessor.cs index b78145089..22297b8f2 100644 --- a/src/ImageSharp/Processing/Convolution/Processors/EdgeDetectorCompassProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetectorCompassProcessor.cs @@ -8,12 +8,11 @@ using System.Runtime.InteropServices; using System.Threading.Tasks; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Primitives; -using SixLabors.ImageSharp.Processing.Filters.Processors; -using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.ImageSharp.Processing.Processors.Filters; using SixLabors.Memory; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Convolution.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Convolution { /// /// Defines a processor that detects edges within an image using a eight two dimensional matrices. diff --git a/src/ImageSharp/Processing/Convolution/Processors/EdgeDetectorProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetectorProcessor.cs similarity index 91% rename from src/ImageSharp/Processing/Convolution/Processors/EdgeDetectorProcessor.cs rename to src/ImageSharp/Processing/Processors/Convolution/EdgeDetectorProcessor.cs index e0ca83828..9173bc229 100644 --- a/src/ImageSharp/Processing/Convolution/Processors/EdgeDetectorProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetectorProcessor.cs @@ -3,11 +3,10 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Primitives; -using SixLabors.ImageSharp.Processing.Filters.Processors; -using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.ImageSharp.Processing.Processors.Filters; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Convolution.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Convolution { /// /// Defines a processor that detects edges within an image using a single two dimensional matrix. diff --git a/src/ImageSharp/Processing/Convolution/Processors/GaussianBlurProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/GaussianBlurProcessor.cs similarity index 98% rename from src/ImageSharp/Processing/Convolution/Processors/GaussianBlurProcessor.cs rename to src/ImageSharp/Processing/Processors/Convolution/GaussianBlurProcessor.cs index 6f33e23ec..3045b9993 100644 --- a/src/ImageSharp/Processing/Convolution/Processors/GaussianBlurProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/GaussianBlurProcessor.cs @@ -7,7 +7,7 @@ using SixLabors.ImageSharp.Primitives; using SixLabors.ImageSharp.Processing.Processors; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Convolution.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Convolution { /// /// Applies Gaussian blur processing to the image. diff --git a/src/ImageSharp/Processing/Convolution/Processors/GaussianSharpenProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/GaussianSharpenProcessor.cs similarity index 96% rename from src/ImageSharp/Processing/Convolution/Processors/GaussianSharpenProcessor.cs rename to src/ImageSharp/Processing/Processors/Convolution/GaussianSharpenProcessor.cs index 5f296e29e..18963c73c 100644 --- a/src/ImageSharp/Processing/Convolution/Processors/GaussianSharpenProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/GaussianSharpenProcessor.cs @@ -4,10 +4,9 @@ using System; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Primitives; -using SixLabors.ImageSharp.Processing.Processors; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Convolution.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Convolution { /// /// Applies Gaussian sharpening processing to the image. @@ -160,14 +159,14 @@ namespace SixLabors.ImageSharp.Processing.Convolution.Processors { for (int i = 0; i < size; i++) { - kernel[0, i] = kernel[0, i] / sum; + kernel[0, i] /= sum; } } else { for (int i = 0; i < size; i++) { - kernel[i, 0] = kernel[i, 0] / sum; + kernel[i, 0] /= sum; } } diff --git a/src/ImageSharp/Processing/Convolution/Processors/IEdgeDetectorProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/IEdgeDetectorProcessor.cs similarity index 93% rename from src/ImageSharp/Processing/Convolution/Processors/IEdgeDetectorProcessor.cs rename to src/ImageSharp/Processing/Processors/Convolution/IEdgeDetectorProcessor.cs index 486929e02..b2ecbf115 100644 --- a/src/ImageSharp/Processing/Convolution/Processors/IEdgeDetectorProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/IEdgeDetectorProcessor.cs @@ -4,7 +4,7 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing.Processors; -namespace SixLabors.ImageSharp.Processing.Convolution.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Convolution { /// /// Provides properties and methods allowing the detection of edges within an image. diff --git a/src/ImageSharp/Processing/Convolution/Processors/KayyaliKernels.cs b/src/ImageSharp/Processing/Processors/Convolution/KayyaliKernels.cs similarity index 93% rename from src/ImageSharp/Processing/Convolution/Processors/KayyaliKernels.cs rename to src/ImageSharp/Processing/Processors/Convolution/KayyaliKernels.cs index e131cac38..dd4d02302 100644 --- a/src/ImageSharp/Processing/Convolution/Processors/KayyaliKernels.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/KayyaliKernels.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.Primitives; -namespace SixLabors.ImageSharp.Processing.Convolution.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Convolution { /// /// Contains the kernels used for Kayyali edge detection diff --git a/src/ImageSharp/Processing/Convolution/Processors/KayyaliProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/KayyaliProcessor.cs similarity index 93% rename from src/ImageSharp/Processing/Convolution/Processors/KayyaliProcessor.cs rename to src/ImageSharp/Processing/Processors/Convolution/KayyaliProcessor.cs index 357c6c397..8652efa12 100644 --- a/src/ImageSharp/Processing/Convolution/Processors/KayyaliProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/KayyaliProcessor.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Convolution.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Convolution { /// /// Applies edge detection processing to the image using the Kayyali operator filter. diff --git a/src/ImageSharp/Processing/Convolution/Processors/KirschProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/KirschProcessor.cs similarity index 96% rename from src/ImageSharp/Processing/Convolution/Processors/KirschProcessor.cs rename to src/ImageSharp/Processing/Processors/Convolution/KirschProcessor.cs index c9a21da0b..46cf00c22 100644 --- a/src/ImageSharp/Processing/Convolution/Processors/KirschProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/KirschProcessor.cs @@ -4,7 +4,7 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Primitives; -namespace SixLabors.ImageSharp.Processing.Convolution.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Convolution { /// /// Applies edge detection processing to the image using the Kirsch operator filter. diff --git a/src/ImageSharp/Processing/Convolution/Processors/KirshKernels.cs b/src/ImageSharp/Processing/Processors/Convolution/KirshKernels.cs similarity index 97% rename from src/ImageSharp/Processing/Convolution/Processors/KirshKernels.cs rename to src/ImageSharp/Processing/Processors/Convolution/KirshKernels.cs index 8e52f8df4..d31587508 100644 --- a/src/ImageSharp/Processing/Convolution/Processors/KirshKernels.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/KirshKernels.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.Primitives; -namespace SixLabors.ImageSharp.Processing.Convolution.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Convolution { /// /// Contains the eight matrices used for Kirsh edge detection diff --git a/src/ImageSharp/Processing/Convolution/Processors/Laplacian3x3Processor.cs b/src/ImageSharp/Processing/Processors/Convolution/Laplacian3x3Processor.cs similarity index 93% rename from src/ImageSharp/Processing/Convolution/Processors/Laplacian3x3Processor.cs rename to src/ImageSharp/Processing/Processors/Convolution/Laplacian3x3Processor.cs index 657a93c81..f498d374c 100644 --- a/src/ImageSharp/Processing/Convolution/Processors/Laplacian3x3Processor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/Laplacian3x3Processor.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Convolution.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Convolution { /// /// Applies edge detection processing to the image using the Laplacian 3x3 operator filter. diff --git a/src/ImageSharp/Processing/Convolution/Processors/Laplacian5x5Processor.cs b/src/ImageSharp/Processing/Processors/Convolution/Laplacian5x5Processor.cs similarity index 93% rename from src/ImageSharp/Processing/Convolution/Processors/Laplacian5x5Processor.cs rename to src/ImageSharp/Processing/Processors/Convolution/Laplacian5x5Processor.cs index 5b44773ad..558acf7b3 100644 --- a/src/ImageSharp/Processing/Convolution/Processors/Laplacian5x5Processor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/Laplacian5x5Processor.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Convolution.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Convolution { /// /// Applies edge detection processing to the image using the Laplacian 5x5 operator filter. diff --git a/src/ImageSharp/Processing/Convolution/Processors/LaplacianKernelFactory.cs b/src/ImageSharp/Processing/Processors/Convolution/LaplacianKernelFactory.cs similarity index 94% rename from src/ImageSharp/Processing/Convolution/Processors/LaplacianKernelFactory.cs rename to src/ImageSharp/Processing/Processors/Convolution/LaplacianKernelFactory.cs index 053033432..19f2d1161 100644 --- a/src/ImageSharp/Processing/Convolution/Processors/LaplacianKernelFactory.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/LaplacianKernelFactory.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.Primitives; -namespace SixLabors.ImageSharp.Processing.Convolution.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Convolution { /// /// A factory for creating Laplacian kernel matrices. diff --git a/src/ImageSharp/Processing/Convolution/Processors/LaplacianKernels.cs b/src/ImageSharp/Processing/Processors/Convolution/LaplacianKernels.cs similarity index 94% rename from src/ImageSharp/Processing/Convolution/Processors/LaplacianKernels.cs rename to src/ImageSharp/Processing/Processors/Convolution/LaplacianKernels.cs index 407736980..e7b7f965b 100644 --- a/src/ImageSharp/Processing/Convolution/Processors/LaplacianKernels.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/LaplacianKernels.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.Primitives; -namespace SixLabors.ImageSharp.Processing.Convolution.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Convolution { /// /// Contains Laplacian kernels of different sizes diff --git a/src/ImageSharp/Processing/Convolution/Processors/LaplacianOfGaussianProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/LaplacianOfGaussianProcessor.cs similarity index 93% rename from src/ImageSharp/Processing/Convolution/Processors/LaplacianOfGaussianProcessor.cs rename to src/ImageSharp/Processing/Processors/Convolution/LaplacianOfGaussianProcessor.cs index e65e0d215..6cc65dc58 100644 --- a/src/ImageSharp/Processing/Convolution/Processors/LaplacianOfGaussianProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/LaplacianOfGaussianProcessor.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Convolution.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Convolution { /// /// Applies edge detection processing to the image using the Laplacian of Gaussian operator filter. diff --git a/src/ImageSharp/Processing/Convolution/Processors/PrewittKernels.cs b/src/ImageSharp/Processing/Processors/Convolution/PrewittKernels.cs similarity index 93% rename from src/ImageSharp/Processing/Convolution/Processors/PrewittKernels.cs rename to src/ImageSharp/Processing/Processors/Convolution/PrewittKernels.cs index aba4d52c3..381e028d4 100644 --- a/src/ImageSharp/Processing/Convolution/Processors/PrewittKernels.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/PrewittKernels.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.Primitives; -namespace SixLabors.ImageSharp.Processing.Convolution.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Convolution { /// /// Contains the kernels used for Prewitt edge detection diff --git a/src/ImageSharp/Processing/Convolution/Processors/PrewittProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/PrewittProcessor.cs similarity index 93% rename from src/ImageSharp/Processing/Convolution/Processors/PrewittProcessor.cs rename to src/ImageSharp/Processing/Processors/Convolution/PrewittProcessor.cs index 5683d6f60..75ef4dac6 100644 --- a/src/ImageSharp/Processing/Convolution/Processors/PrewittProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/PrewittProcessor.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Convolution.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Convolution { /// /// Applies edge detection processing to the image using the Prewitt operator filter. diff --git a/src/ImageSharp/Processing/Convolution/Processors/RobertsCrossKernels.cs b/src/ImageSharp/Processing/Processors/Convolution/RobertsCrossKernels.cs similarity index 92% rename from src/ImageSharp/Processing/Convolution/Processors/RobertsCrossKernels.cs rename to src/ImageSharp/Processing/Processors/Convolution/RobertsCrossKernels.cs index 64d1fcea5..f61220e1e 100644 --- a/src/ImageSharp/Processing/Convolution/Processors/RobertsCrossKernels.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/RobertsCrossKernels.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.Primitives; -namespace SixLabors.ImageSharp.Processing.Convolution.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Convolution { /// /// Contains the kernels used for RobertsCross edge detection diff --git a/src/ImageSharp/Processing/Convolution/Processors/RobertsCrossProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/RobertsCrossProcessor.cs similarity index 93% rename from src/ImageSharp/Processing/Convolution/Processors/RobertsCrossProcessor.cs rename to src/ImageSharp/Processing/Processors/Convolution/RobertsCrossProcessor.cs index 38d1fffc9..d685860f6 100644 --- a/src/ImageSharp/Processing/Convolution/Processors/RobertsCrossProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/RobertsCrossProcessor.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Convolution.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Convolution { /// /// Applies edge detection processing to the image using the Roberts Cross operator filter. diff --git a/src/ImageSharp/Processing/Convolution/Processors/RobinsonKernels.cs b/src/ImageSharp/Processing/Processors/Convolution/RobinsonKernels.cs similarity index 97% rename from src/ImageSharp/Processing/Convolution/Processors/RobinsonKernels.cs rename to src/ImageSharp/Processing/Processors/Convolution/RobinsonKernels.cs index 9d440fcc0..4f47184e3 100644 --- a/src/ImageSharp/Processing/Convolution/Processors/RobinsonKernels.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/RobinsonKernels.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.Primitives; -namespace SixLabors.ImageSharp.Processing.Convolution.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Convolution { /// /// Contains the kernels used for Robinson edge detection diff --git a/src/ImageSharp/Processing/Convolution/Processors/RobinsonProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/RobinsonProcessor.cs similarity index 96% rename from src/ImageSharp/Processing/Convolution/Processors/RobinsonProcessor.cs rename to src/ImageSharp/Processing/Processors/Convolution/RobinsonProcessor.cs index f129b1daa..193c1008d 100644 --- a/src/ImageSharp/Processing/Convolution/Processors/RobinsonProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/RobinsonProcessor.cs @@ -4,7 +4,7 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Primitives; -namespace SixLabors.ImageSharp.Processing.Convolution.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Convolution { /// /// Applies edge detection processing to the image using the Robinson operator filter. diff --git a/src/ImageSharp/Processing/Convolution/Processors/ScharrKernels.cs b/src/ImageSharp/Processing/Processors/Convolution/ScharrKernels.cs similarity index 93% rename from src/ImageSharp/Processing/Convolution/Processors/ScharrKernels.cs rename to src/ImageSharp/Processing/Processors/Convolution/ScharrKernels.cs index c309e4cec..f0662c667 100644 --- a/src/ImageSharp/Processing/Convolution/Processors/ScharrKernels.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/ScharrKernels.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.Primitives; -namespace SixLabors.ImageSharp.Processing.Convolution.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Convolution { /// /// Contains the kernels used for Scharr edge detection diff --git a/src/ImageSharp/Processing/Convolution/Processors/ScharrProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/ScharrProcessor.cs similarity index 93% rename from src/ImageSharp/Processing/Convolution/Processors/ScharrProcessor.cs rename to src/ImageSharp/Processing/Processors/Convolution/ScharrProcessor.cs index c101d092d..79fc0e79f 100644 --- a/src/ImageSharp/Processing/Convolution/Processors/ScharrProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/ScharrProcessor.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Convolution.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Convolution { /// /// Applies edge detection processing to the image using the Scharr operator filter. diff --git a/src/ImageSharp/Processing/Convolution/Processors/SobelKernels.cs b/src/ImageSharp/Processing/Processors/Convolution/SobelKernels.cs similarity index 93% rename from src/ImageSharp/Processing/Convolution/Processors/SobelKernels.cs rename to src/ImageSharp/Processing/Processors/Convolution/SobelKernels.cs index 626226c66..113957c83 100644 --- a/src/ImageSharp/Processing/Convolution/Processors/SobelKernels.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/SobelKernels.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.Primitives; -namespace SixLabors.ImageSharp.Processing.Convolution.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Convolution { /// /// Contains the kernels used for Sobel edge detection diff --git a/src/ImageSharp/Processing/Convolution/Processors/SobelProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/SobelProcessor.cs similarity index 93% rename from src/ImageSharp/Processing/Convolution/Processors/SobelProcessor.cs rename to src/ImageSharp/Processing/Processors/Convolution/SobelProcessor.cs index 9fb9c56c4..3ca53f6f0 100644 --- a/src/ImageSharp/Processing/Convolution/Processors/SobelProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/SobelProcessor.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Convolution.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Convolution { /// /// The Sobel operator filter. diff --git a/src/ImageSharp/Processing/Processors/DelegateProcessor.cs b/src/ImageSharp/Processing/Processors/DelegateProcessor.cs index 2ff00d583..7a9753d1a 100644 --- a/src/ImageSharp/Processing/Processors/DelegateProcessor.cs +++ b/src/ImageSharp/Processing/Processors/DelegateProcessor.cs @@ -14,26 +14,24 @@ namespace SixLabors.ImageSharp.Processing.Processors internal class DelegateProcessor : ImageProcessor where TPixel : struct, IPixel { - private readonly Action> action; - /// /// Initializes a new instance of the class. /// /// The action. public DelegateProcessor(Action> action) { - this.action = action; + this.Action = action; } /// /// Gets the action that will be applied to the image. /// - internal Action> Action => this.action; + internal Action> Action { get; } /// protected override void BeforeImageApply(Image source, Rectangle sourceRectangle) { - this.action?.Invoke(source); + this.Action?.Invoke(source); } /// diff --git a/src/ImageSharp/Processing/Dithering/ErrorDiffusion/AtkinsonDiffuser.cs b/src/ImageSharp/Processing/Processors/Dithering/AtkinsonDiffuser.cs similarity index 93% rename from src/ImageSharp/Processing/Dithering/ErrorDiffusion/AtkinsonDiffuser.cs rename to src/ImageSharp/Processing/Processors/Dithering/AtkinsonDiffuser.cs index 2b13980fc..17c97ddc9 100644 --- a/src/ImageSharp/Processing/Dithering/ErrorDiffusion/AtkinsonDiffuser.cs +++ b/src/ImageSharp/Processing/Processors/Dithering/AtkinsonDiffuser.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.Primitives; -namespace SixLabors.ImageSharp.Processing.Dithering.ErrorDiffusion +namespace SixLabors.ImageSharp.Processing.Processors.Dithering { /// /// Applies error diffusion based dithering using the Atkinson image dithering algorithm. diff --git a/src/ImageSharp/Processing/Dithering/Ordered/BayerDither2x2.cs b/src/ImageSharp/Processing/Processors/Dithering/BayerDither2x2.cs similarity index 88% rename from src/ImageSharp/Processing/Dithering/Ordered/BayerDither2x2.cs rename to src/ImageSharp/Processing/Processors/Dithering/BayerDither2x2.cs index 2d674787a..b7fdfbfe5 100644 --- a/src/ImageSharp/Processing/Dithering/Ordered/BayerDither2x2.cs +++ b/src/ImageSharp/Processing/Processors/Dithering/BayerDither2x2.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing.Dithering.Ordered +namespace SixLabors.ImageSharp.Processing.Processors.Dithering { /// /// Applies order dithering using the 2x2 Bayer dithering matrix. diff --git a/src/ImageSharp/Processing/Dithering/Ordered/BayerDither4x4.cs b/src/ImageSharp/Processing/Processors/Dithering/BayerDither4x4.cs similarity index 88% rename from src/ImageSharp/Processing/Dithering/Ordered/BayerDither4x4.cs rename to src/ImageSharp/Processing/Processors/Dithering/BayerDither4x4.cs index edc57441a..4f6d5dd07 100644 --- a/src/ImageSharp/Processing/Dithering/Ordered/BayerDither4x4.cs +++ b/src/ImageSharp/Processing/Processors/Dithering/BayerDither4x4.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing.Dithering.Ordered +namespace SixLabors.ImageSharp.Processing.Processors.Dithering { /// /// Applies order dithering using the 4x4 Bayer dithering matrix. diff --git a/src/ImageSharp/Processing/Dithering/Ordered/BayerDither8x8.cs b/src/ImageSharp/Processing/Processors/Dithering/BayerDither8x8.cs similarity index 88% rename from src/ImageSharp/Processing/Dithering/Ordered/BayerDither8x8.cs rename to src/ImageSharp/Processing/Processors/Dithering/BayerDither8x8.cs index b79216208..8d0c23aa3 100644 --- a/src/ImageSharp/Processing/Dithering/Ordered/BayerDither8x8.cs +++ b/src/ImageSharp/Processing/Processors/Dithering/BayerDither8x8.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing.Dithering.Ordered +namespace SixLabors.ImageSharp.Processing.Processors.Dithering { /// /// Applies order dithering using the 8x8 Bayer dithering matrix. diff --git a/src/ImageSharp/Processing/Dithering/ErrorDiffusion/BurksDiffuser.cs b/src/ImageSharp/Processing/Processors/Dithering/BurksDiffuser.cs similarity index 92% rename from src/ImageSharp/Processing/Dithering/ErrorDiffusion/BurksDiffuser.cs rename to src/ImageSharp/Processing/Processors/Dithering/BurksDiffuser.cs index b4b439c9a..84455b24a 100644 --- a/src/ImageSharp/Processing/Dithering/ErrorDiffusion/BurksDiffuser.cs +++ b/src/ImageSharp/Processing/Processors/Dithering/BurksDiffuser.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.Primitives; -namespace SixLabors.ImageSharp.Processing.Dithering.ErrorDiffusion +namespace SixLabors.ImageSharp.Processing.Processors.Dithering { /// /// Applies error diffusion based dithering using the Burks image dithering algorithm. diff --git a/src/ImageSharp/Processing/Dithering/DHALF.TXT b/src/ImageSharp/Processing/Processors/Dithering/DHALF.TXT similarity index 100% rename from src/ImageSharp/Processing/Dithering/DHALF.TXT rename to src/ImageSharp/Processing/Processors/Dithering/DHALF.TXT diff --git a/src/ImageSharp/Processing/Dithering/DITHER.TXT b/src/ImageSharp/Processing/Processors/Dithering/DITHER.TXT similarity index 100% rename from src/ImageSharp/Processing/Dithering/DITHER.TXT rename to src/ImageSharp/Processing/Processors/Dithering/DITHER.TXT diff --git a/src/ImageSharp/Processing/Dithering/ErrorDiffusion/ErrorDiffuserBase.cs b/src/ImageSharp/Processing/Processors/Dithering/ErrorDiffuserBase.cs similarity index 98% rename from src/ImageSharp/Processing/Dithering/ErrorDiffusion/ErrorDiffuserBase.cs rename to src/ImageSharp/Processing/Processors/Dithering/ErrorDiffuserBase.cs index 80b3698a6..b407841f2 100644 --- a/src/ImageSharp/Processing/Dithering/ErrorDiffusion/ErrorDiffuserBase.cs +++ b/src/ImageSharp/Processing/Processors/Dithering/ErrorDiffuserBase.cs @@ -8,7 +8,7 @@ using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Primitives; -namespace SixLabors.ImageSharp.Processing.Dithering.ErrorDiffusion +namespace SixLabors.ImageSharp.Processing.Processors.Dithering { /// /// The base class for performing error diffusion based dithering. diff --git a/src/ImageSharp/Processing/Dithering/Processors/ErrorDiffusionPaletteProcessor.cs b/src/ImageSharp/Processing/Processors/Dithering/ErrorDiffusionPaletteProcessor.cs similarity index 96% rename from src/ImageSharp/Processing/Dithering/Processors/ErrorDiffusionPaletteProcessor.cs rename to src/ImageSharp/Processing/Processors/Dithering/ErrorDiffusionPaletteProcessor.cs index 19fde8487..8e2b2a5a8 100644 --- a/src/ImageSharp/Processing/Dithering/Processors/ErrorDiffusionPaletteProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Dithering/ErrorDiffusionPaletteProcessor.cs @@ -4,11 +4,10 @@ using System; using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Dithering.ErrorDiffusion; -using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.ImageSharp.Processing.Processors.Dithering; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Dithering.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Dithering { /// /// An that dithers an image using error diffusion. diff --git a/src/ImageSharp/Processing/Dithering/ErrorDiffusion/FloydSteinbergDiffuser.cs b/src/ImageSharp/Processing/Processors/Dithering/FloydSteinbergDiffuser.cs similarity index 93% rename from src/ImageSharp/Processing/Dithering/ErrorDiffusion/FloydSteinbergDiffuser.cs rename to src/ImageSharp/Processing/Processors/Dithering/FloydSteinbergDiffuser.cs index 290d77864..6a7655b59 100644 --- a/src/ImageSharp/Processing/Dithering/ErrorDiffusion/FloydSteinbergDiffuser.cs +++ b/src/ImageSharp/Processing/Processors/Dithering/FloydSteinbergDiffuser.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.Primitives; -namespace SixLabors.ImageSharp.Processing.Dithering.ErrorDiffusion +namespace SixLabors.ImageSharp.Processing.Processors.Dithering { /// /// Applies error diffusion based dithering using the Floyd–Steinberg image dithering algorithm. diff --git a/src/ImageSharp/Processing/Dithering/ErrorDiffusion/IErrorDiffuser.cs b/src/ImageSharp/Processing/Processors/Dithering/IErrorDiffuser.cs similarity index 94% rename from src/ImageSharp/Processing/Dithering/ErrorDiffusion/IErrorDiffuser.cs rename to src/ImageSharp/Processing/Processors/Dithering/IErrorDiffuser.cs index 795aa6506..5b30c0dc4 100644 --- a/src/ImageSharp/Processing/Dithering/ErrorDiffusion/IErrorDiffuser.cs +++ b/src/ImageSharp/Processing/Processors/Dithering/IErrorDiffuser.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Dithering.ErrorDiffusion +namespace SixLabors.ImageSharp.Processing.Processors.Dithering { /// /// Encapsulates properties and methods required to perform diffused error dithering on an image. diff --git a/src/ImageSharp/Processing/Dithering/Ordered/IOrderedDither.cs b/src/ImageSharp/Processing/Processors/Dithering/IOrderedDither.cs similarity index 95% rename from src/ImageSharp/Processing/Dithering/Ordered/IOrderedDither.cs rename to src/ImageSharp/Processing/Processors/Dithering/IOrderedDither.cs index 29b96ab45..571929b99 100644 --- a/src/ImageSharp/Processing/Dithering/Ordered/IOrderedDither.cs +++ b/src/ImageSharp/Processing/Processors/Dithering/IOrderedDither.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Dithering.Ordered +namespace SixLabors.ImageSharp.Processing.Processors.Dithering { /// /// Encapsulates properties and methods required to perform ordered dithering on an image. diff --git a/src/ImageSharp/Processing/Dithering/ErrorDiffusion/JarvisJudiceNinkeDiffuser.cs b/src/ImageSharp/Processing/Processors/Dithering/JarvisJudiceNinkeDiffuser.cs similarity index 93% rename from src/ImageSharp/Processing/Dithering/ErrorDiffusion/JarvisJudiceNinkeDiffuser.cs rename to src/ImageSharp/Processing/Processors/Dithering/JarvisJudiceNinkeDiffuser.cs index 816447ec9..a69557d6d 100644 --- a/src/ImageSharp/Processing/Dithering/ErrorDiffusion/JarvisJudiceNinkeDiffuser.cs +++ b/src/ImageSharp/Processing/Processors/Dithering/JarvisJudiceNinkeDiffuser.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.Primitives; -namespace SixLabors.ImageSharp.Processing.Dithering.ErrorDiffusion +namespace SixLabors.ImageSharp.Processing.Processors.Dithering { /// /// Applies error diffusion based dithering using the JarvisJudiceNinke image dithering algorithm. diff --git a/src/ImageSharp/Processing/Dithering/Ordered/OrderedDither.cs b/src/ImageSharp/Processing/Processors/Dithering/OrderedDither.cs similarity index 96% rename from src/ImageSharp/Processing/Dithering/Ordered/OrderedDither.cs rename to src/ImageSharp/Processing/Processors/Dithering/OrderedDither.cs index 9fd274ab7..174732f80 100644 --- a/src/ImageSharp/Processing/Dithering/Ordered/OrderedDither.cs +++ b/src/ImageSharp/Processing/Processors/Dithering/OrderedDither.cs @@ -4,7 +4,7 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Primitives; -namespace SixLabors.ImageSharp.Processing.Dithering.Ordered +namespace SixLabors.ImageSharp.Processing.Processors.Dithering { /// /// An ordered dithering matrix with equal sides of arbitrary length diff --git a/src/ImageSharp/Processing/Dithering/Ordered/OrderedDither3x3.cs b/src/ImageSharp/Processing/Processors/Dithering/OrderedDither3x3.cs similarity index 88% rename from src/ImageSharp/Processing/Dithering/Ordered/OrderedDither3x3.cs rename to src/ImageSharp/Processing/Processors/Dithering/OrderedDither3x3.cs index dd20817cf..93bce0578 100644 --- a/src/ImageSharp/Processing/Dithering/Ordered/OrderedDither3x3.cs +++ b/src/ImageSharp/Processing/Processors/Dithering/OrderedDither3x3.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing.Dithering.Ordered +namespace SixLabors.ImageSharp.Processing.Processors.Dithering { /// /// Applies order dithering using the 3x3 dithering matrix. diff --git a/src/ImageSharp/Processing/Dithering/Ordered/OrderedDitherFactory.cs b/src/ImageSharp/Processing/Processors/Dithering/OrderedDitherFactory.cs similarity index 98% rename from src/ImageSharp/Processing/Dithering/Ordered/OrderedDitherFactory.cs rename to src/ImageSharp/Processing/Processors/Dithering/OrderedDitherFactory.cs index 7538aa50e..4b93c4259 100644 --- a/src/ImageSharp/Processing/Dithering/Ordered/OrderedDitherFactory.cs +++ b/src/ImageSharp/Processing/Processors/Dithering/OrderedDitherFactory.cs @@ -4,7 +4,7 @@ using System.Runtime.CompilerServices; using SixLabors.ImageSharp.Primitives; -namespace SixLabors.ImageSharp.Processing.Dithering.Ordered +namespace SixLabors.ImageSharp.Processing.Processors.Dithering { /// /// A factory for creating ordered dither matrices. diff --git a/src/ImageSharp/Processing/Dithering/Processors/OrderedDitherPaletteProcessor.cs b/src/ImageSharp/Processing/Processors/Dithering/OrderedDitherPaletteProcessor.cs similarity index 95% rename from src/ImageSharp/Processing/Dithering/Processors/OrderedDitherPaletteProcessor.cs rename to src/ImageSharp/Processing/Processors/Dithering/OrderedDitherPaletteProcessor.cs index 32a3d290e..4100fef8c 100644 --- a/src/ImageSharp/Processing/Dithering/Processors/OrderedDitherPaletteProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Dithering/OrderedDitherPaletteProcessor.cs @@ -4,11 +4,10 @@ using System; using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Dithering.Ordered; -using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.ImageSharp.Processing.Processors.Dithering; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Dithering.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Dithering { /// /// An that dithers an image using error diffusion. diff --git a/src/ImageSharp/Processing/Dithering/Processors/PaletteDitherProcessorBase.cs b/src/ImageSharp/Processing/Processors/Dithering/PaletteDitherProcessorBase.cs similarity index 96% rename from src/ImageSharp/Processing/Dithering/Processors/PaletteDitherProcessorBase.cs rename to src/ImageSharp/Processing/Processors/Dithering/PaletteDitherProcessorBase.cs index 0e801e583..e70c8acd2 100644 --- a/src/ImageSharp/Processing/Dithering/Processors/PaletteDitherProcessorBase.cs +++ b/src/ImageSharp/Processing/Processors/Dithering/PaletteDitherProcessorBase.cs @@ -5,9 +5,8 @@ using System.Collections.Generic; using System.Numerics; using System.Runtime.CompilerServices; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Processors; -namespace SixLabors.ImageSharp.Processing.Dithering.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Dithering { /// /// The base class for dither and diffusion processors that consume a palette. diff --git a/src/ImageSharp/Processing/Dithering/Processors/PixelPair.cs b/src/ImageSharp/Processing/Processors/Dithering/PixelPair.cs similarity index 96% rename from src/ImageSharp/Processing/Dithering/Processors/PixelPair.cs rename to src/ImageSharp/Processing/Processors/Dithering/PixelPair.cs index 127c0be6d..b7bea2c74 100644 --- a/src/ImageSharp/Processing/Dithering/Processors/PixelPair.cs +++ b/src/ImageSharp/Processing/Processors/Dithering/PixelPair.cs @@ -4,7 +4,7 @@ using System; using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Dithering.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Dithering { /// /// Represents a composite pair of pixels. Used for caching color distance lookups. diff --git a/src/ImageSharp/Processing/Dithering/ErrorDiffusion/Sierra2Diffuser.cs b/src/ImageSharp/Processing/Processors/Dithering/Sierra2Diffuser.cs similarity index 93% rename from src/ImageSharp/Processing/Dithering/ErrorDiffusion/Sierra2Diffuser.cs rename to src/ImageSharp/Processing/Processors/Dithering/Sierra2Diffuser.cs index 0b7e13c84..ebde2ceaf 100644 --- a/src/ImageSharp/Processing/Dithering/ErrorDiffusion/Sierra2Diffuser.cs +++ b/src/ImageSharp/Processing/Processors/Dithering/Sierra2Diffuser.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.Primitives; -namespace SixLabors.ImageSharp.Processing.Dithering.ErrorDiffusion +namespace SixLabors.ImageSharp.Processing.Processors.Dithering { /// /// Applies error diffusion based dithering using the Sierra2 image dithering algorithm. diff --git a/src/ImageSharp/Processing/Dithering/ErrorDiffusion/Sierra3Diffuser.cs b/src/ImageSharp/Processing/Processors/Dithering/Sierra3Diffuser.cs similarity index 93% rename from src/ImageSharp/Processing/Dithering/ErrorDiffusion/Sierra3Diffuser.cs rename to src/ImageSharp/Processing/Processors/Dithering/Sierra3Diffuser.cs index 937b3a8cb..144a83a82 100644 --- a/src/ImageSharp/Processing/Dithering/ErrorDiffusion/Sierra3Diffuser.cs +++ b/src/ImageSharp/Processing/Processors/Dithering/Sierra3Diffuser.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.Primitives; -namespace SixLabors.ImageSharp.Processing.Dithering.ErrorDiffusion +namespace SixLabors.ImageSharp.Processing.Processors.Dithering { /// /// Applies error diffusion based dithering using the Sierra3 image dithering algorithm. diff --git a/src/ImageSharp/Processing/Dithering/ErrorDiffusion/SierraLiteDiffuser.cs b/src/ImageSharp/Processing/Processors/Dithering/SierraLiteDiffuser.cs similarity index 93% rename from src/ImageSharp/Processing/Dithering/ErrorDiffusion/SierraLiteDiffuser.cs rename to src/ImageSharp/Processing/Processors/Dithering/SierraLiteDiffuser.cs index c9594e9e2..d71fba9f2 100644 --- a/src/ImageSharp/Processing/Dithering/ErrorDiffusion/SierraLiteDiffuser.cs +++ b/src/ImageSharp/Processing/Processors/Dithering/SierraLiteDiffuser.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.Primitives; -namespace SixLabors.ImageSharp.Processing.Dithering.ErrorDiffusion +namespace SixLabors.ImageSharp.Processing.Processors.Dithering { /// /// Applies error diffusion based dithering using the SierraLite image dithering algorithm. diff --git a/src/ImageSharp/Processing/Dithering/ErrorDiffusion/StevensonArceDiffuser.cs b/src/ImageSharp/Processing/Processors/Dithering/StevensonArceDiffuser.cs similarity index 93% rename from src/ImageSharp/Processing/Dithering/ErrorDiffusion/StevensonArceDiffuser.cs rename to src/ImageSharp/Processing/Processors/Dithering/StevensonArceDiffuser.cs index 749502a03..4b1323065 100644 --- a/src/ImageSharp/Processing/Dithering/ErrorDiffusion/StevensonArceDiffuser.cs +++ b/src/ImageSharp/Processing/Processors/Dithering/StevensonArceDiffuser.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.Primitives; -namespace SixLabors.ImageSharp.Processing.Dithering.ErrorDiffusion +namespace SixLabors.ImageSharp.Processing.Processors.Dithering { /// /// Applies error diffusion based dithering using the Stevenson-Arce image dithering algorithm. diff --git a/src/ImageSharp/Processing/Dithering/ErrorDiffusion/StuckiDiffuser.cs b/src/ImageSharp/Processing/Processors/Dithering/StuckiDiffuser.cs similarity index 93% rename from src/ImageSharp/Processing/Dithering/ErrorDiffusion/StuckiDiffuser.cs rename to src/ImageSharp/Processing/Processors/Dithering/StuckiDiffuser.cs index 077c02cbd..1dd510a5e 100644 --- a/src/ImageSharp/Processing/Dithering/ErrorDiffusion/StuckiDiffuser.cs +++ b/src/ImageSharp/Processing/Processors/Dithering/StuckiDiffuser.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.Primitives; -namespace SixLabors.ImageSharp.Processing.Dithering.ErrorDiffusion +namespace SixLabors.ImageSharp.Processing.Processors.Dithering { /// /// Applies error diffusion based dithering using the Stucki image dithering algorithm. diff --git a/src/ImageSharp/Processing/Dithering/error_diffusion.txt b/src/ImageSharp/Processing/Processors/Dithering/error_diffusion.txt similarity index 100% rename from src/ImageSharp/Processing/Dithering/error_diffusion.txt rename to src/ImageSharp/Processing/Processors/Dithering/error_diffusion.txt diff --git a/src/ImageSharp/Processing/Effects/Processors/OilPaintingProcessor.cs b/src/ImageSharp/Processing/Processors/Effects/OilPaintingProcessor.cs similarity index 97% rename from src/ImageSharp/Processing/Effects/Processors/OilPaintingProcessor.cs rename to src/ImageSharp/Processing/Processors/Effects/OilPaintingProcessor.cs index cdaa6113f..b9329f4df 100644 --- a/src/ImageSharp/Processing/Effects/Processors/OilPaintingProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Effects/OilPaintingProcessor.cs @@ -6,11 +6,10 @@ using System.Numerics; using System.Threading.Tasks; using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Processors; using SixLabors.Memory; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Effects.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Effects { /// /// Applies oil painting effect processing to the image. @@ -112,7 +111,7 @@ namespace SixLabors.ImageSharp.Processing.Effects.Processors int currentIntensity = (int)MathF.Round((sourceBlue + sourceGreen + sourceRed) / 3F * (levels - 1)); - intensityBin[currentIntensity] += 1; + intensityBin[currentIntensity]++; blueBin[currentIntensity] += sourceBlue; greenBin[currentIntensity] += sourceGreen; redBin[currentIntensity] += sourceRed; diff --git a/src/ImageSharp/Processing/Effects/Processors/PixelateProcessor.cs b/src/ImageSharp/Processing/Processors/Effects/PixelateProcessor.cs similarity index 97% rename from src/ImageSharp/Processing/Effects/Processors/PixelateProcessor.cs rename to src/ImageSharp/Processing/Processors/Effects/PixelateProcessor.cs index d45d2093f..56085e76c 100644 --- a/src/ImageSharp/Processing/Effects/Processors/PixelateProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Effects/PixelateProcessor.cs @@ -7,10 +7,9 @@ using System.Threading.Tasks; using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.Common; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Processors; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Effects.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Effects { /// /// Applies a pixelation effect processing to the image. diff --git a/src/ImageSharp/Processing/Filters/Processors/AchromatomalyProcessor.cs b/src/ImageSharp/Processing/Processors/Filters/AchromatomalyProcessor.cs similarity index 92% rename from src/ImageSharp/Processing/Filters/Processors/AchromatomalyProcessor.cs rename to src/ImageSharp/Processing/Processors/Filters/AchromatomalyProcessor.cs index e7238c68c..57c1bad39 100644 --- a/src/ImageSharp/Processing/Filters/Processors/AchromatomalyProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Filters/AchromatomalyProcessor.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Filters.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Filters { /// /// Converts the colors of the image recreating Achromatomaly (Color desensitivity) color blindness. diff --git a/src/ImageSharp/Processing/Filters/Processors/AchromatopsiaProcessor.cs b/src/ImageSharp/Processing/Processors/Filters/AchromatopsiaProcessor.cs similarity index 92% rename from src/ImageSharp/Processing/Filters/Processors/AchromatopsiaProcessor.cs rename to src/ImageSharp/Processing/Processors/Filters/AchromatopsiaProcessor.cs index b581f8925..696a854ab 100644 --- a/src/ImageSharp/Processing/Filters/Processors/AchromatopsiaProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Filters/AchromatopsiaProcessor.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Filters.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Filters { /// /// Converts the colors of the image recreating Achromatopsia (Monochrome) color blindness. diff --git a/src/ImageSharp/Processing/Filters/Processors/BlackWhiteProcessor.cs b/src/ImageSharp/Processing/Processors/Filters/BlackWhiteProcessor.cs similarity index 91% rename from src/ImageSharp/Processing/Filters/Processors/BlackWhiteProcessor.cs rename to src/ImageSharp/Processing/Processors/Filters/BlackWhiteProcessor.cs index 428b9d4dd..9925ce5c2 100644 --- a/src/ImageSharp/Processing/Filters/Processors/BlackWhiteProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Filters/BlackWhiteProcessor.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Filters.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Filters { /// /// Applies a black and white filter matrix to the image diff --git a/src/ImageSharp/Processing/Filters/Processors/BrightnessProcessor.cs b/src/ImageSharp/Processing/Processors/Filters/BrightnessProcessor.cs similarity index 95% rename from src/ImageSharp/Processing/Filters/Processors/BrightnessProcessor.cs rename to src/ImageSharp/Processing/Processors/Filters/BrightnessProcessor.cs index e5c43bd8a..b1b8ad747 100644 --- a/src/ImageSharp/Processing/Filters/Processors/BrightnessProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Filters/BrightnessProcessor.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Filters.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Filters { /// /// Applies a brightness filter matrix using the given amount. diff --git a/src/ImageSharp/Processing/Filters/Processors/ContrastProcessor.cs b/src/ImageSharp/Processing/Processors/Filters/ContrastProcessor.cs similarity index 95% rename from src/ImageSharp/Processing/Filters/Processors/ContrastProcessor.cs rename to src/ImageSharp/Processing/Processors/Filters/ContrastProcessor.cs index 51f8ba6b1..ebec464d5 100644 --- a/src/ImageSharp/Processing/Filters/Processors/ContrastProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Filters/ContrastProcessor.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Filters.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Filters { /// /// Applies a contrast filter matrix using the given amount. diff --git a/src/ImageSharp/Processing/Filters/Processors/DeuteranomalyProcessor.cs b/src/ImageSharp/Processing/Processors/Filters/DeuteranomalyProcessor.cs similarity index 92% rename from src/ImageSharp/Processing/Filters/Processors/DeuteranomalyProcessor.cs rename to src/ImageSharp/Processing/Processors/Filters/DeuteranomalyProcessor.cs index d93068c8c..0d1b1da90 100644 --- a/src/ImageSharp/Processing/Filters/Processors/DeuteranomalyProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Filters/DeuteranomalyProcessor.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Filters.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Filters { /// /// Converts the colors of the image recreating Deuteranomaly (Green-Weak) color blindness. diff --git a/src/ImageSharp/Processing/Filters/Processors/DeuteranopiaProcessor.cs b/src/ImageSharp/Processing/Processors/Filters/DeuteranopiaProcessor.cs similarity index 92% rename from src/ImageSharp/Processing/Filters/Processors/DeuteranopiaProcessor.cs rename to src/ImageSharp/Processing/Processors/Filters/DeuteranopiaProcessor.cs index 4b57a1fa4..ae0727048 100644 --- a/src/ImageSharp/Processing/Filters/Processors/DeuteranopiaProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Filters/DeuteranopiaProcessor.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Filters.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Filters { /// /// Converts the colors of the image recreating Deuteranopia (Green-Blind) color blindness. diff --git a/src/ImageSharp/Processing/Filters/Processors/FilterProcessor.cs b/src/ImageSharp/Processing/Processors/Filters/FilterProcessor.cs similarity index 94% rename from src/ImageSharp/Processing/Filters/Processors/FilterProcessor.cs rename to src/ImageSharp/Processing/Processors/Filters/FilterProcessor.cs index 18163b754..e8a1fc9cb 100644 --- a/src/ImageSharp/Processing/Filters/Processors/FilterProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Filters/FilterProcessor.cs @@ -6,10 +6,9 @@ using System.Numerics; using System.Threading.Tasks; using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Processors; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Filters.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Filters { /// /// Provides methods that accept a matrix to apply free-form filters to images. diff --git a/src/ImageSharp/Processing/Filters/Processors/GrayscaleBt601Processor.cs b/src/ImageSharp/Processing/Processors/Filters/GrayscaleBt601Processor.cs similarity index 94% rename from src/ImageSharp/Processing/Filters/Processors/GrayscaleBt601Processor.cs rename to src/ImageSharp/Processing/Processors/Filters/GrayscaleBt601Processor.cs index b4ea8ac6b..c933d4858 100644 --- a/src/ImageSharp/Processing/Filters/Processors/GrayscaleBt601Processor.cs +++ b/src/ImageSharp/Processing/Processors/Filters/GrayscaleBt601Processor.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Filters.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Filters { /// /// Applies a grayscale filter matrix using the given amount and the formula as specified by ITU-R Recommendation BT.601 diff --git a/src/ImageSharp/Processing/Filters/Processors/GrayscaleBt709Processor.cs b/src/ImageSharp/Processing/Processors/Filters/GrayscaleBt709Processor.cs similarity index 94% rename from src/ImageSharp/Processing/Filters/Processors/GrayscaleBt709Processor.cs rename to src/ImageSharp/Processing/Processors/Filters/GrayscaleBt709Processor.cs index 480b134d3..1716773b4 100644 --- a/src/ImageSharp/Processing/Filters/Processors/GrayscaleBt709Processor.cs +++ b/src/ImageSharp/Processing/Processors/Filters/GrayscaleBt709Processor.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Filters.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Filters { /// /// Applies a grayscale filter matrix using the given amount and the formula as specified by ITU-R Recommendation BT.709 diff --git a/src/ImageSharp/Processing/Filters/Processors/HueProcessor.cs b/src/ImageSharp/Processing/Processors/Filters/HueProcessor.cs similarity index 93% rename from src/ImageSharp/Processing/Filters/Processors/HueProcessor.cs rename to src/ImageSharp/Processing/Processors/Filters/HueProcessor.cs index 95ae98e78..4c3a0c73e 100644 --- a/src/ImageSharp/Processing/Filters/Processors/HueProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Filters/HueProcessor.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Filters.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Filters { /// /// Applies a hue filter matrix using the given angle of rotation in degrees diff --git a/src/ImageSharp/Processing/Filters/Processors/InvertProcessor.cs b/src/ImageSharp/Processing/Processors/Filters/InvertProcessor.cs similarity index 94% rename from src/ImageSharp/Processing/Filters/Processors/InvertProcessor.cs rename to src/ImageSharp/Processing/Processors/Filters/InvertProcessor.cs index 7b8ed2a03..462c42070 100644 --- a/src/ImageSharp/Processing/Filters/Processors/InvertProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Filters/InvertProcessor.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Filters.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Filters { /// /// Applies a filter matrix that inverts the colors of an image diff --git a/src/ImageSharp/Processing/Filters/Processors/KodachromeProcessor.cs b/src/ImageSharp/Processing/Processors/Filters/KodachromeProcessor.cs similarity index 92% rename from src/ImageSharp/Processing/Filters/Processors/KodachromeProcessor.cs rename to src/ImageSharp/Processing/Processors/Filters/KodachromeProcessor.cs index cc3fa42f6..003766e8a 100644 --- a/src/ImageSharp/Processing/Filters/Processors/KodachromeProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Filters/KodachromeProcessor.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Filters.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Filters { /// /// Applies a filter matrix recreating an old Kodachrome camera effect matrix to the image diff --git a/src/ImageSharp/Processing/Filters/Processors/LomographProcessor.cs b/src/ImageSharp/Processing/Processors/Filters/LomographProcessor.cs similarity index 90% rename from src/ImageSharp/Processing/Filters/Processors/LomographProcessor.cs rename to src/ImageSharp/Processing/Processors/Filters/LomographProcessor.cs index d97bf57dd..737ebf618 100644 --- a/src/ImageSharp/Processing/Filters/Processors/LomographProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Filters/LomographProcessor.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Overlays.Processors; +using SixLabors.ImageSharp.Processing.Processors.Overlays; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Filters.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Filters { /// /// Converts the colors of the image recreating an old Lomograph effect. diff --git a/src/ImageSharp/Processing/Filters/Processors/OpacityProcessor.cs b/src/ImageSharp/Processing/Processors/Filters/OpacityProcessor.cs similarity index 94% rename from src/ImageSharp/Processing/Filters/Processors/OpacityProcessor.cs rename to src/ImageSharp/Processing/Processors/Filters/OpacityProcessor.cs index f50d27ae0..0fea61cad 100644 --- a/src/ImageSharp/Processing/Filters/Processors/OpacityProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Filters/OpacityProcessor.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Filters.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Filters { /// /// Applies an opacity filter matrix using the given amount. diff --git a/src/ImageSharp/Processing/Filters/Processors/PolaroidProcessor.cs b/src/ImageSharp/Processing/Processors/Filters/PolaroidProcessor.cs similarity index 91% rename from src/ImageSharp/Processing/Filters/Processors/PolaroidProcessor.cs rename to src/ImageSharp/Processing/Processors/Filters/PolaroidProcessor.cs index b6aa56223..fb065ac17 100644 --- a/src/ImageSharp/Processing/Filters/Processors/PolaroidProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Filters/PolaroidProcessor.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Overlays.Processors; +using SixLabors.ImageSharp.Processing.Processors.Overlays; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Filters.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Filters { /// /// Converts the colors of the image recreating an old Polaroid effect. diff --git a/src/ImageSharp/Processing/Filters/Processors/ProtanomalyProcessor.cs b/src/ImageSharp/Processing/Processors/Filters/ProtanomalyProcessor.cs similarity index 92% rename from src/ImageSharp/Processing/Filters/Processors/ProtanomalyProcessor.cs rename to src/ImageSharp/Processing/Processors/Filters/ProtanomalyProcessor.cs index 88e2ee3c3..79eb70851 100644 --- a/src/ImageSharp/Processing/Filters/Processors/ProtanomalyProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Filters/ProtanomalyProcessor.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Filters.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Filters { /// /// Converts the colors of the image recreating Protanomaly (Red-Weak) color blindness. diff --git a/src/ImageSharp/Processing/Filters/Processors/ProtanopiaProcessor.cs b/src/ImageSharp/Processing/Processors/Filters/ProtanopiaProcessor.cs similarity index 92% rename from src/ImageSharp/Processing/Filters/Processors/ProtanopiaProcessor.cs rename to src/ImageSharp/Processing/Processors/Filters/ProtanopiaProcessor.cs index 17020bbe2..c6a01439a 100644 --- a/src/ImageSharp/Processing/Filters/Processors/ProtanopiaProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Filters/ProtanopiaProcessor.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Filters.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Filters { /// /// Converts the colors of the image recreating Protanopia (Red-Blind) color blindness. diff --git a/src/ImageSharp/Processing/Filters/Processors/README.md b/src/ImageSharp/Processing/Processors/Filters/README.md similarity index 100% rename from src/ImageSharp/Processing/Filters/Processors/README.md rename to src/ImageSharp/Processing/Processors/Filters/README.md diff --git a/src/ImageSharp/Processing/Filters/Processors/SaturateProcessor.cs b/src/ImageSharp/Processing/Processors/Filters/SaturateProcessor.cs similarity index 95% rename from src/ImageSharp/Processing/Filters/Processors/SaturateProcessor.cs rename to src/ImageSharp/Processing/Processors/Filters/SaturateProcessor.cs index d4b28a894..75e956071 100644 --- a/src/ImageSharp/Processing/Filters/Processors/SaturateProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Filters/SaturateProcessor.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Filters.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Filters { /// /// Applies a saturation filter matrix using the given amount. diff --git a/src/ImageSharp/Processing/Filters/Processors/SepiaProcessor.cs b/src/ImageSharp/Processing/Processors/Filters/SepiaProcessor.cs similarity index 93% rename from src/ImageSharp/Processing/Filters/Processors/SepiaProcessor.cs rename to src/ImageSharp/Processing/Processors/Filters/SepiaProcessor.cs index 7295cee99..2009dccd5 100644 --- a/src/ImageSharp/Processing/Filters/Processors/SepiaProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Filters/SepiaProcessor.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Filters.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Filters { /// /// Applies a sepia filter matrix using the given amount. diff --git a/src/ImageSharp/Processing/Filters/Processors/TritanomalyProcessor.cs b/src/ImageSharp/Processing/Processors/Filters/TritanomalyProcessor.cs similarity index 92% rename from src/ImageSharp/Processing/Filters/Processors/TritanomalyProcessor.cs rename to src/ImageSharp/Processing/Processors/Filters/TritanomalyProcessor.cs index 6991506e6..593f7f5b0 100644 --- a/src/ImageSharp/Processing/Filters/Processors/TritanomalyProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Filters/TritanomalyProcessor.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Filters.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Filters { /// /// Converts the colors of the image recreating Tritanomaly (Blue-Weak) color blindness. diff --git a/src/ImageSharp/Processing/Filters/Processors/TritanopiaProcessor.cs b/src/ImageSharp/Processing/Processors/Filters/TritanopiaProcessor.cs similarity index 92% rename from src/ImageSharp/Processing/Filters/Processors/TritanopiaProcessor.cs rename to src/ImageSharp/Processing/Processors/Filters/TritanopiaProcessor.cs index 95c6cb542..153ad5559 100644 --- a/src/ImageSharp/Processing/Filters/Processors/TritanopiaProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Filters/TritanopiaProcessor.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Filters.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Filters { /// /// Converts the colors of the image recreating Tritanopia (Blue-Blind) color blindness. diff --git a/src/ImageSharp/Processing/Overlays/Processors/BackgroundColorProcessor.cs b/src/ImageSharp/Processing/Processors/Overlays/BackgroundColorProcessor.cs similarity index 96% rename from src/ImageSharp/Processing/Overlays/Processors/BackgroundColorProcessor.cs rename to src/ImageSharp/Processing/Processors/Overlays/BackgroundColorProcessor.cs index cc7e2ad8b..797d388c0 100644 --- a/src/ImageSharp/Processing/Overlays/Processors/BackgroundColorProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Overlays/BackgroundColorProcessor.cs @@ -5,11 +5,10 @@ using System; using System.Threading.Tasks; using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Processors; using SixLabors.Memory; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Overlays.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Overlays { /// /// Sets the background color of the image. diff --git a/src/ImageSharp/Processing/Overlays/Processors/GlowProcessor.cs b/src/ImageSharp/Processing/Processors/Overlays/GlowProcessor.cs similarity index 98% rename from src/ImageSharp/Processing/Overlays/Processors/GlowProcessor.cs rename to src/ImageSharp/Processing/Processors/Overlays/GlowProcessor.cs index 51634ea2c..023643520 100644 --- a/src/ImageSharp/Processing/Overlays/Processors/GlowProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Overlays/GlowProcessor.cs @@ -7,11 +7,10 @@ using System.Threading.Tasks; using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Primitives; -using SixLabors.ImageSharp.Processing.Processors; using SixLabors.Memory; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Overlays.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Overlays { /// /// An that applies a radial glow effect an . diff --git a/src/ImageSharp/Processing/Overlays/Processors/VignetteProcessor.cs b/src/ImageSharp/Processing/Processors/Overlays/VignetteProcessor.cs similarity index 98% rename from src/ImageSharp/Processing/Overlays/Processors/VignetteProcessor.cs rename to src/ImageSharp/Processing/Processors/Overlays/VignetteProcessor.cs index b73fab179..3789e6bf8 100644 --- a/src/ImageSharp/Processing/Overlays/Processors/VignetteProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Overlays/VignetteProcessor.cs @@ -7,11 +7,10 @@ using System.Threading.Tasks; using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Primitives; -using SixLabors.ImageSharp.Processing.Processors; using SixLabors.Memory; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Overlays.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Overlays { /// /// An that applies a radial vignette effect to an . diff --git a/src/ImageSharp/Processing/Quantization/FrameQuantizers/FrameQuantizerBase{TPixel}.cs b/src/ImageSharp/Processing/Processors/Quantization/FrameQuantizerBase{TPixel}.cs similarity index 98% rename from src/ImageSharp/Processing/Quantization/FrameQuantizers/FrameQuantizerBase{TPixel}.cs rename to src/ImageSharp/Processing/Processors/Quantization/FrameQuantizerBase{TPixel}.cs index 6637d54e0..6e594f223 100644 --- a/src/ImageSharp/Processing/Quantization/FrameQuantizers/FrameQuantizerBase{TPixel}.cs +++ b/src/ImageSharp/Processing/Processors/Quantization/FrameQuantizerBase{TPixel}.cs @@ -6,9 +6,9 @@ using System.Collections.Generic; using System.Numerics; using System.Runtime.CompilerServices; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Dithering.ErrorDiffusion; +using SixLabors.ImageSharp.Processing.Processors.Dithering; -namespace SixLabors.ImageSharp.Processing.Quantization.FrameQuantizers +namespace SixLabors.ImageSharp.Processing.Processors.Quantization { /// /// The base class for all implementations diff --git a/src/ImageSharp/Processing/Quantization/FrameQuantizers/IFrameQuantizer{TPixel}.cs b/src/ImageSharp/Processing/Processors/Quantization/IFrameQuantizer{TPixel}.cs similarity index 89% rename from src/ImageSharp/Processing/Quantization/FrameQuantizers/IFrameQuantizer{TPixel}.cs rename to src/ImageSharp/Processing/Processors/Quantization/IFrameQuantizer{TPixel}.cs index 435302bd3..50fdb5b58 100644 --- a/src/ImageSharp/Processing/Quantization/FrameQuantizers/IFrameQuantizer{TPixel}.cs +++ b/src/ImageSharp/Processing/Processors/Quantization/IFrameQuantizer{TPixel}.cs @@ -2,9 +2,9 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Dithering.ErrorDiffusion; +using SixLabors.ImageSharp.Processing.Processors.Dithering; -namespace SixLabors.ImageSharp.Processing.Quantization.FrameQuantizers +namespace SixLabors.ImageSharp.Processing.Processors.Quantization { /// /// Provides methods to allow the execution of the quantization process on an image frame. diff --git a/src/ImageSharp/Processing/Quantization/IQuantizer.cs b/src/ImageSharp/Processing/Processors/Quantization/IQuantizer.cs similarity index 81% rename from src/ImageSharp/Processing/Quantization/IQuantizer.cs rename to src/ImageSharp/Processing/Processors/Quantization/IQuantizer.cs index e00b865ac..0f6846d1b 100644 --- a/src/ImageSharp/Processing/Quantization/IQuantizer.cs +++ b/src/ImageSharp/Processing/Processors/Quantization/IQuantizer.cs @@ -2,10 +2,9 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Dithering.ErrorDiffusion; -using SixLabors.ImageSharp.Processing.Quantization.FrameQuantizers; +using SixLabors.ImageSharp.Processing.Processors.Dithering; -namespace SixLabors.ImageSharp.Processing.Quantization +namespace SixLabors.ImageSharp.Processing.Processors.Quantization { /// /// Provides methods for allowing quantization of images pixels with configurable dithering. diff --git a/src/ImageSharp/Processing/Quantization/FrameQuantizers/OctreeFrameQuantizer{TPixel}.cs b/src/ImageSharp/Processing/Processors/Quantization/OctreeFrameQuantizer{TPixel}.cs similarity index 99% rename from src/ImageSharp/Processing/Quantization/FrameQuantizers/OctreeFrameQuantizer{TPixel}.cs rename to src/ImageSharp/Processing/Processors/Quantization/OctreeFrameQuantizer{TPixel}.cs index d73373395..0eb3db864 100644 --- a/src/ImageSharp/Processing/Quantization/FrameQuantizers/OctreeFrameQuantizer{TPixel}.cs +++ b/src/ImageSharp/Processing/Processors/Quantization/OctreeFrameQuantizer{TPixel}.cs @@ -9,7 +9,7 @@ using System.Runtime.InteropServices; using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Quantization.FrameQuantizers +namespace SixLabors.ImageSharp.Processing.Processors.Quantization { /// /// Encapsulates methods to calculate the color palette if an image using an Octree pattern. diff --git a/src/ImageSharp/Processing/Quantization/OctreeQuantizer.cs b/src/ImageSharp/Processing/Processors/Quantization/OctreeQuantizer.cs similarity index 92% rename from src/ImageSharp/Processing/Quantization/OctreeQuantizer.cs rename to src/ImageSharp/Processing/Processors/Quantization/OctreeQuantizer.cs index 385ddceec..385f6246f 100644 --- a/src/ImageSharp/Processing/Quantization/OctreeQuantizer.cs +++ b/src/ImageSharp/Processing/Processors/Quantization/OctreeQuantizer.cs @@ -2,11 +2,9 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Dithering; -using SixLabors.ImageSharp.Processing.Dithering.ErrorDiffusion; -using SixLabors.ImageSharp.Processing.Quantization.FrameQuantizers; +using SixLabors.ImageSharp.Processing.Processors.Dithering; -namespace SixLabors.ImageSharp.Processing.Quantization +namespace SixLabors.ImageSharp.Processing.Processors.Quantization { /// /// Allows the quantization of images pixels using Octrees. diff --git a/src/ImageSharp/Processing/Quantization/FrameQuantizers/PaletteFrameQuantizer{TPixel}.cs b/src/ImageSharp/Processing/Processors/Quantization/PaletteFrameQuantizer{TPixel}.cs similarity index 98% rename from src/ImageSharp/Processing/Quantization/FrameQuantizers/PaletteFrameQuantizer{TPixel}.cs rename to src/ImageSharp/Processing/Processors/Quantization/PaletteFrameQuantizer{TPixel}.cs index cb72626d5..8df81b426 100644 --- a/src/ImageSharp/Processing/Quantization/FrameQuantizers/PaletteFrameQuantizer{TPixel}.cs +++ b/src/ImageSharp/Processing/Processors/Quantization/PaletteFrameQuantizer{TPixel}.cs @@ -8,7 +8,7 @@ using System.Runtime.InteropServices; using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Quantization.FrameQuantizers +namespace SixLabors.ImageSharp.Processing.Processors.Quantization { /// /// Encapsulates methods to create a quantized image based upon the given palette. diff --git a/src/ImageSharp/Processing/Quantization/PaletteQuantizer.cs b/src/ImageSharp/Processing/Processors/Quantization/PaletteQuantizer.cs similarity index 91% rename from src/ImageSharp/Processing/Quantization/PaletteQuantizer.cs rename to src/ImageSharp/Processing/Processors/Quantization/PaletteQuantizer.cs index dd10a040a..8ae917718 100644 --- a/src/ImageSharp/Processing/Quantization/PaletteQuantizer.cs +++ b/src/ImageSharp/Processing/Processors/Quantization/PaletteQuantizer.cs @@ -3,11 +3,9 @@ using System; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Dithering; -using SixLabors.ImageSharp.Processing.Dithering.ErrorDiffusion; -using SixLabors.ImageSharp.Processing.Quantization.FrameQuantizers; +using SixLabors.ImageSharp.Processing.Processors.Dithering; -namespace SixLabors.ImageSharp.Processing.Quantization +namespace SixLabors.ImageSharp.Processing.Processors.Quantization { /// /// Allows the quantization of images pixels using web safe colors defined in the CSS Color Module Level 4. diff --git a/src/ImageSharp/Processing/Quantization/Processors/QuantizeProcessor.cs b/src/ImageSharp/Processing/Processors/Quantization/QuantizeProcessor.cs similarity index 92% rename from src/ImageSharp/Processing/Quantization/Processors/QuantizeProcessor.cs rename to src/ImageSharp/Processing/Processors/Quantization/QuantizeProcessor.cs index 5b20805b0..bd5a6e9ec 100644 --- a/src/ImageSharp/Processing/Quantization/Processors/QuantizeProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Quantization/QuantizeProcessor.cs @@ -4,11 +4,9 @@ using System; using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Processors; -using SixLabors.ImageSharp.Processing.Quantization.FrameQuantizers; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Quantization.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Quantization { /// /// Enables the quantization of images to reduce the number of colors used in the image palette. diff --git a/src/ImageSharp/Processing/Quantization/QuantizedFrame{TPixel}.cs b/src/ImageSharp/Processing/Processors/Quantization/QuantizedFrame{TPixel}.cs similarity index 97% rename from src/ImageSharp/Processing/Quantization/QuantizedFrame{TPixel}.cs rename to src/ImageSharp/Processing/Processors/Quantization/QuantizedFrame{TPixel}.cs index 6699c76f4..977b939a1 100644 --- a/src/ImageSharp/Processing/Quantization/QuantizedFrame{TPixel}.cs +++ b/src/ImageSharp/Processing/Processors/Quantization/QuantizedFrame{TPixel}.cs @@ -6,7 +6,7 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.Memory; // TODO: Consider pooling the TPixel palette also. For Rgba48+ this would end up on th LOH if 256 colors. -namespace SixLabors.ImageSharp.Processing.Quantization +namespace SixLabors.ImageSharp.Processing.Processors.Quantization { /// /// Represents a quantized image frame where the pixels indexed by a color palette. diff --git a/src/ImageSharp/Processing/Quantization/FrameQuantizers/WuFrameQuantizer{TPixel}.cs b/src/ImageSharp/Processing/Processors/Quantization/WuFrameQuantizer{TPixel}.cs similarity index 99% rename from src/ImageSharp/Processing/Quantization/FrameQuantizers/WuFrameQuantizer{TPixel}.cs rename to src/ImageSharp/Processing/Processors/Quantization/WuFrameQuantizer{TPixel}.cs index cb8721d06..7c2ff77e3 100644 --- a/src/ImageSharp/Processing/Quantization/FrameQuantizers/WuFrameQuantizer{TPixel}.cs +++ b/src/ImageSharp/Processing/Processors/Quantization/WuFrameQuantizer{TPixel}.cs @@ -10,7 +10,7 @@ using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; using SixLabors.Memory; -namespace SixLabors.ImageSharp.Processing.Quantization.FrameQuantizers +namespace SixLabors.ImageSharp.Processing.Processors.Quantization { /// /// An implementation of Wu's color quantizer with alpha channel. diff --git a/src/ImageSharp/Processing/Quantization/WuQuantizer.cs b/src/ImageSharp/Processing/Processors/Quantization/WuQuantizer.cs similarity index 92% rename from src/ImageSharp/Processing/Quantization/WuQuantizer.cs rename to src/ImageSharp/Processing/Processors/Quantization/WuQuantizer.cs index f46cddfe6..3aa1f4c5e 100644 --- a/src/ImageSharp/Processing/Quantization/WuQuantizer.cs +++ b/src/ImageSharp/Processing/Processors/Quantization/WuQuantizer.cs @@ -2,11 +2,9 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Dithering; -using SixLabors.ImageSharp.Processing.Dithering.ErrorDiffusion; -using SixLabors.ImageSharp.Processing.Quantization.FrameQuantizers; +using SixLabors.ImageSharp.Processing.Processors.Dithering; -namespace SixLabors.ImageSharp.Processing.Quantization +namespace SixLabors.ImageSharp.Processing.Processors.Quantization { /// /// Allows the quantization of images pixels using Xiaolin Wu's Color Quantizer diff --git a/src/ImageSharp/Processing/Transforms/Processors/AffineTransformProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/AffineTransformProcessor.cs similarity index 98% rename from src/ImageSharp/Processing/Transforms/Processors/AffineTransformProcessor.cs rename to src/ImageSharp/Processing/Processors/Transforms/AffineTransformProcessor.cs index 2e1a88983..d9f35c892 100644 --- a/src/ImageSharp/Processing/Transforms/Processors/AffineTransformProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/AffineTransformProcessor.cs @@ -10,11 +10,10 @@ using System.Runtime.InteropServices; using System.Threading.Tasks; using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Transforms.Resamplers; using SixLabors.Memory; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Transforms.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Transforms { /// /// Provides the base methods to perform affine transforms on an image. diff --git a/src/ImageSharp/Processing/Transforms/Processors/AutoOrientProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/AutoOrientProcessor.cs similarity index 98% rename from src/ImageSharp/Processing/Transforms/Processors/AutoOrientProcessor.cs rename to src/ImageSharp/Processing/Processors/Transforms/AutoOrientProcessor.cs index 68dc7f0ad..c077914ff 100644 --- a/src/ImageSharp/Processing/Transforms/Processors/AutoOrientProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/AutoOrientProcessor.cs @@ -7,7 +7,7 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing.Processors; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Transforms.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Transforms { /// /// Adjusts an image so that its orientation is suitable for viewing. Adjustments are based on EXIF metadata embedded in the image. diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/BicubicResampler.cs b/src/ImageSharp/Processing/Processors/Transforms/BicubicResampler.cs similarity index 95% rename from src/ImageSharp/Processing/Transforms/Resamplers/BicubicResampler.cs rename to src/ImageSharp/Processing/Processors/Transforms/BicubicResampler.cs index dd655a8a3..199563bc7 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/BicubicResampler.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/BicubicResampler.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing.Transforms.Resamplers +namespace SixLabors.ImageSharp.Processing.Processors.Transforms { /// /// 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/Processors/Transforms/BoxResampler.cs similarity index 90% rename from src/ImageSharp/Processing/Transforms/Resamplers/BoxResampler.cs rename to src/ImageSharp/Processing/Processors/Transforms/BoxResampler.cs index d6f79721c..0667226d9 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/BoxResampler.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/BoxResampler.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing.Transforms.Resamplers +namespace SixLabors.ImageSharp.Processing.Processors.Transforms { /// /// 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/Processors/Transforms/CatmullRomResampler.cs similarity index 92% rename from src/ImageSharp/Processing/Transforms/Resamplers/CatmullRomResampler.cs rename to src/ImageSharp/Processing/Processors/Transforms/CatmullRomResampler.cs index 7284bf715..8995d2d8a 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/CatmullRomResampler.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/CatmullRomResampler.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing.Transforms.Resamplers +namespace SixLabors.ImageSharp.Processing.Processors.Transforms { /// /// The Catmull-Rom filter is a well known standard Cubic Filter often used as a interpolation function. diff --git a/src/ImageSharp/Processing/Transforms/Processors/CenteredAffineTransformProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/CenteredAffineTransformProcessor.cs similarity index 93% rename from src/ImageSharp/Processing/Transforms/Processors/CenteredAffineTransformProcessor.cs rename to src/ImageSharp/Processing/Processors/Transforms/CenteredAffineTransformProcessor.cs index adeed55ef..adaee1766 100644 --- a/src/ImageSharp/Processing/Transforms/Processors/CenteredAffineTransformProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/CenteredAffineTransformProcessor.cs @@ -3,10 +3,9 @@ using System.Numerics; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Transforms.Resamplers; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Transforms.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Transforms { /// /// A base class that provides methods to allow the automatic centering of affine transforms diff --git a/src/ImageSharp/Processing/Transforms/Processors/CenteredProjectiveTransformProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/CenteredProjectiveTransformProcessor.cs similarity index 93% rename from src/ImageSharp/Processing/Transforms/Processors/CenteredProjectiveTransformProcessor.cs rename to src/ImageSharp/Processing/Processors/Transforms/CenteredProjectiveTransformProcessor.cs index 5cdcde483..962b9e4c9 100644 --- a/src/ImageSharp/Processing/Transforms/Processors/CenteredProjectiveTransformProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/CenteredProjectiveTransformProcessor.cs @@ -3,10 +3,9 @@ using System.Numerics; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Transforms.Resamplers; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Transforms.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Transforms { /// /// A base class that provides methods to allow the automatic centering of non-affine transforms diff --git a/src/ImageSharp/Processing/Transforms/Processors/CropProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/CropProcessor.cs similarity index 97% rename from src/ImageSharp/Processing/Transforms/Processors/CropProcessor.cs rename to src/ImageSharp/Processing/Processors/Transforms/CropProcessor.cs index 2228c69fa..5d714eef5 100644 --- a/src/ImageSharp/Processing/Transforms/Processors/CropProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/CropProcessor.cs @@ -9,7 +9,7 @@ using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Transforms.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Transforms { /// /// Provides methods to allow the cropping of an image. diff --git a/src/ImageSharp/Processing/Transforms/Processors/EntropyCropProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/EntropyCropProcessor.cs similarity index 89% rename from src/ImageSharp/Processing/Transforms/Processors/EntropyCropProcessor.cs rename to src/ImageSharp/Processing/Processors/Transforms/EntropyCropProcessor.cs index 66b781517..8eeae5d1f 100644 --- a/src/ImageSharp/Processing/Transforms/Processors/EntropyCropProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/EntropyCropProcessor.cs @@ -3,12 +3,11 @@ using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Binarization.Processors; -using SixLabors.ImageSharp.Processing.Convolution.Processors; -using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.ImageSharp.Processing.Processors.Binarization; +using SixLabors.ImageSharp.Processing.Processors.Convolution; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Transforms.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Transforms { /// /// Provides methods to allow the cropping of an image to preserve areas of highest entropy. @@ -67,7 +66,7 @@ namespace SixLabors.ImageSharp.Processing.Transforms.Processors } /// - protected override void OnFrameApply(ImageFrame sourceBase, Rectangle sourceRectangle, Configuration config) + protected override void OnFrameApply(ImageFrame source, Rectangle sourceRectangle, Configuration configuration) { // All processing happens at the image level within BeforeImageApply(); } diff --git a/src/ImageSharp/Processing/Transforms/Processors/FlipProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/FlipProcessor.cs similarity index 93% rename from src/ImageSharp/Processing/Transforms/Processors/FlipProcessor.cs rename to src/ImageSharp/Processing/Processors/Transforms/FlipProcessor.cs index 5d4961f57..4ab4971b8 100644 --- a/src/ImageSharp/Processing/Transforms/Processors/FlipProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/FlipProcessor.cs @@ -5,11 +5,10 @@ using System; using System.Threading.Tasks; using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Processors; using SixLabors.Memory; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Transforms.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Transforms { /// /// Provides methods that allow the flipping of an image around its center point. @@ -21,14 +20,14 @@ namespace SixLabors.ImageSharp.Processing.Transforms.Processors /// /// Initializes a new instance of the class. /// - /// The used to perform flipping. + /// The used to perform flipping. public FlipProcessor(FlipMode flipMode) { this.FlipMode = flipMode; } /// - /// Gets the used to perform flipping. + /// Gets the used to perform flipping. /// public FlipMode FlipMode { get; } diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/HermiteResampler.cs b/src/ImageSharp/Processing/Processors/Transforms/HermiteResampler.cs similarity index 91% rename from src/ImageSharp/Processing/Transforms/Resamplers/HermiteResampler.cs rename to src/ImageSharp/Processing/Processors/Transforms/HermiteResampler.cs index 2017a1cb5..18c3fda7c 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/HermiteResampler.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/HermiteResampler.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing.Transforms.Resamplers +namespace SixLabors.ImageSharp.Processing.Processors.Transforms { /// /// The Hermite filter is type of smoothed triangular interpolation Filter, diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/IResampler.cs b/src/ImageSharp/Processing/Processors/Transforms/IResampler.cs similarity index 91% rename from src/ImageSharp/Processing/Transforms/Resamplers/IResampler.cs rename to src/ImageSharp/Processing/Processors/Transforms/IResampler.cs index 6bc4feaf0..6db03d5b4 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/IResampler.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/IResampler.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing.Transforms.Resamplers +namespace SixLabors.ImageSharp.Processing.Processors.Transforms { /// /// Encapsulates an interpolation algorithm for resampling images. diff --git a/src/ImageSharp/Processing/Transforms/Processors/InterpolatedTransformProcessorBase.cs b/src/ImageSharp/Processing/Processors/Transforms/InterpolatedTransformProcessorBase.cs similarity index 97% rename from src/ImageSharp/Processing/Transforms/Processors/InterpolatedTransformProcessorBase.cs rename to src/ImageSharp/Processing/Processors/Transforms/InterpolatedTransformProcessorBase.cs index 8f57f3ba3..c1abb4a5e 100644 --- a/src/ImageSharp/Processing/Transforms/Processors/InterpolatedTransformProcessorBase.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/InterpolatedTransformProcessorBase.cs @@ -4,9 +4,8 @@ using System; using System.Runtime.CompilerServices; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Transforms.Resamplers; -namespace SixLabors.ImageSharp.Processing.Transforms.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Transforms { /// /// The base class for performing interpolated affine and non-affine transforms. diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/Lanczos2Resampler.cs b/src/ImageSharp/Processing/Processors/Transforms/Lanczos2Resampler.cs similarity index 92% rename from src/ImageSharp/Processing/Transforms/Resamplers/Lanczos2Resampler.cs rename to src/ImageSharp/Processing/Processors/Transforms/Lanczos2Resampler.cs index 35735189a..2294696de 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/Lanczos2Resampler.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/Lanczos2Resampler.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing.Transforms.Resamplers +namespace SixLabors.ImageSharp.Processing.Processors.Transforms { /// /// The function implements the Lanczos kernel algorithm as described on diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/Lanczos3Resampler.cs b/src/ImageSharp/Processing/Processors/Transforms/Lanczos3Resampler.cs similarity index 92% rename from src/ImageSharp/Processing/Transforms/Resamplers/Lanczos3Resampler.cs rename to src/ImageSharp/Processing/Processors/Transforms/Lanczos3Resampler.cs index fa85767a6..95fb206a9 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/Lanczos3Resampler.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/Lanczos3Resampler.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing.Transforms.Resamplers +namespace SixLabors.ImageSharp.Processing.Processors.Transforms { /// /// The function implements the Lanczos kernel algorithm as described on diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/Lanczos5Resampler.cs b/src/ImageSharp/Processing/Processors/Transforms/Lanczos5Resampler.cs similarity index 92% rename from src/ImageSharp/Processing/Transforms/Resamplers/Lanczos5Resampler.cs rename to src/ImageSharp/Processing/Processors/Transforms/Lanczos5Resampler.cs index ec6b7181a..c99ed1e85 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/Lanczos5Resampler.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/Lanczos5Resampler.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing.Transforms.Resamplers +namespace SixLabors.ImageSharp.Processing.Processors.Transforms { /// /// The function implements the Lanczos kernel algorithm as described on diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/Lanczos8Resampler.cs b/src/ImageSharp/Processing/Processors/Transforms/Lanczos8Resampler.cs similarity index 92% rename from src/ImageSharp/Processing/Transforms/Resamplers/Lanczos8Resampler.cs rename to src/ImageSharp/Processing/Processors/Transforms/Lanczos8Resampler.cs index c1f6aecf1..4efdb882b 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/Lanczos8Resampler.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/Lanczos8Resampler.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing.Transforms.Resamplers +namespace SixLabors.ImageSharp.Processing.Processors.Transforms { /// /// The function implements the Lanczos kernel algorithm as described on diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/MitchellNetravaliResampler.cs b/src/ImageSharp/Processing/Processors/Transforms/MitchellNetravaliResampler.cs similarity index 90% rename from src/ImageSharp/Processing/Transforms/Resamplers/MitchellNetravaliResampler.cs rename to src/ImageSharp/Processing/Processors/Transforms/MitchellNetravaliResampler.cs index b7817400b..d4ba954f2 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/MitchellNetravaliResampler.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/MitchellNetravaliResampler.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing.Transforms.Resamplers +namespace SixLabors.ImageSharp.Processing.Processors.Transforms { /// /// The function implements the mitchell algorithm as described on diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/NearestNeighborResampler.cs b/src/ImageSharp/Processing/Processors/Transforms/NearestNeighborResampler.cs similarity index 89% rename from src/ImageSharp/Processing/Transforms/Resamplers/NearestNeighborResampler.cs rename to src/ImageSharp/Processing/Processors/Transforms/NearestNeighborResampler.cs index 61155132e..1f12334f4 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/NearestNeighborResampler.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/NearestNeighborResampler.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing.Transforms.Resamplers +namespace SixLabors.ImageSharp.Processing.Processors.Transforms { /// /// The function implements the nearest neighbor algorithm. This uses an unscaled filter diff --git a/src/ImageSharp/Processing/Transforms/Processors/ProjectiveTransformProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/ProjectiveTransformProcessor.cs similarity index 97% rename from src/ImageSharp/Processing/Transforms/Processors/ProjectiveTransformProcessor.cs rename to src/ImageSharp/Processing/Processors/Transforms/ProjectiveTransformProcessor.cs index 24a72fefb..716133fb7 100644 --- a/src/ImageSharp/Processing/Transforms/Processors/ProjectiveTransformProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/ProjectiveTransformProcessor.cs @@ -10,12 +10,10 @@ using System.Runtime.InteropServices; using System.Threading.Tasks; using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Transforms.Resamplers; using SixLabors.Memory; using SixLabors.Primitives; -// TODO: Doesn't work yet! Implement tests + Finish implementation + Document Matrix4x4 behavior -namespace SixLabors.ImageSharp.Processing.Transforms.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Transforms { /// /// Provides the base methods to perform non-affine transforms on an image. diff --git a/src/ImageSharp/Processing/Transforms/Processors/ResizeProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs similarity index 98% rename from src/ImageSharp/Processing/Transforms/Processors/ResizeProcessor.cs rename to src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs index dfb3a82ff..8c9ab9a23 100644 --- a/src/ImageSharp/Processing/Transforms/Processors/ResizeProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs @@ -10,11 +10,10 @@ using System.Runtime.InteropServices; using System.Threading.Tasks; using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Transforms.Resamplers; using SixLabors.Memory; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Transforms.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Transforms { /// /// Provides methods that allow the resizing of images using various algorithms. @@ -202,7 +201,7 @@ namespace SixLabors.ImageSharp.Processing.Transforms.Processors { // weights[w] = weights[w] / sum: ref float wRef = ref Unsafe.Add(ref weightsBaseRef, w); - wRef = wRef / sum; + wRef /= sum; } } } diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/RobidouxResampler.cs b/src/ImageSharp/Processing/Processors/Transforms/RobidouxResampler.cs similarity index 90% rename from src/ImageSharp/Processing/Transforms/Resamplers/RobidouxResampler.cs rename to src/ImageSharp/Processing/Processors/Transforms/RobidouxResampler.cs index 03a6e8677..51938566c 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/RobidouxResampler.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/RobidouxResampler.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing.Transforms.Resamplers +namespace SixLabors.ImageSharp.Processing.Processors.Transforms { /// /// The function implements the Robidoux algorithm. diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/RobidouxSharpResampler.cs b/src/ImageSharp/Processing/Processors/Transforms/RobidouxSharpResampler.cs similarity index 90% rename from src/ImageSharp/Processing/Transforms/Resamplers/RobidouxSharpResampler.cs rename to src/ImageSharp/Processing/Processors/Transforms/RobidouxSharpResampler.cs index 83213c3f4..015b7f0af 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/RobidouxSharpResampler.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/RobidouxSharpResampler.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing.Transforms.Resamplers +namespace SixLabors.ImageSharp.Processing.Processors.Transforms { /// /// The function implements the Robidoux Sharp algorithm. diff --git a/src/ImageSharp/Processing/Transforms/Processors/RotateProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/RotateProcessor.cs similarity index 98% rename from src/ImageSharp/Processing/Transforms/Processors/RotateProcessor.cs rename to src/ImageSharp/Processing/Processors/Transforms/RotateProcessor.cs index 62c3e476b..d57e9cbd9 100644 --- a/src/ImageSharp/Processing/Transforms/Processors/RotateProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/RotateProcessor.cs @@ -6,10 +6,10 @@ using System.Threading.Tasks; using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.MetaData.Profiles.Exif; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Transforms.Resamplers; +using SixLabors.ImageSharp.Processing.Processors.Transforms; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Transforms.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Transforms { /// /// Provides methods that allow the rotating of images. diff --git a/src/ImageSharp/Processing/Transforms/Processors/SkewProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/SkewProcessor.cs similarity index 94% rename from src/ImageSharp/Processing/Transforms/Processors/SkewProcessor.cs rename to src/ImageSharp/Processing/Processors/Transforms/SkewProcessor.cs index 61e8b1268..a0cfa6379 100644 --- a/src/ImageSharp/Processing/Transforms/Processors/SkewProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/SkewProcessor.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Transforms.Resamplers; +using SixLabors.ImageSharp.Processing.Processors.Transforms; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Transforms.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Transforms { /// /// Provides methods that allow the skewing of images. diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/SplineResampler.cs b/src/ImageSharp/Processing/Processors/Transforms/SplineResampler.cs similarity index 90% rename from src/ImageSharp/Processing/Transforms/Resamplers/SplineResampler.cs rename to src/ImageSharp/Processing/Processors/Transforms/SplineResampler.cs index 45f18a4a0..df6c2a338 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/SplineResampler.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/SplineResampler.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing.Transforms.Resamplers +namespace SixLabors.ImageSharp.Processing.Processors.Transforms { /// /// The function implements the spline algorithm. diff --git a/src/ImageSharp/Processing/Transforms/TransformHelpers.cs b/src/ImageSharp/Processing/Processors/Transforms/TransformHelpers.cs similarity index 99% rename from src/ImageSharp/Processing/Transforms/TransformHelpers.cs rename to src/ImageSharp/Processing/Processors/Transforms/TransformHelpers.cs index 71d3b35c1..1b676139b 100644 --- a/src/ImageSharp/Processing/Transforms/TransformHelpers.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/TransformHelpers.cs @@ -7,7 +7,7 @@ using SixLabors.ImageSharp.MetaData.Profiles.Exif; using SixLabors.ImageSharp.PixelFormats; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Transforms +namespace SixLabors.ImageSharp.Processing.Processors.Transforms { /// /// Contains helper methods for working with affine and non-affine transforms diff --git a/src/ImageSharp/Processing/Transforms/Processors/TransformProcessorBase.cs b/src/ImageSharp/Processing/Processors/Transforms/TransformProcessorBase.cs similarity index 92% rename from src/ImageSharp/Processing/Transforms/Processors/TransformProcessorBase.cs rename to src/ImageSharp/Processing/Processors/Transforms/TransformProcessorBase.cs index 0ca5ee191..13ee90a06 100644 --- a/src/ImageSharp/Processing/Transforms/Processors/TransformProcessorBase.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/TransformProcessorBase.cs @@ -5,7 +5,7 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing.Processors; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Transforms.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Transforms { /// /// The base class for all transform processors. Any processor that changes the dimensions of the image should inherit from this. diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/TriangleResampler.cs b/src/ImageSharp/Processing/Processors/Transforms/TriangleResampler.cs similarity index 92% rename from src/ImageSharp/Processing/Transforms/Resamplers/TriangleResampler.cs rename to src/ImageSharp/Processing/Processors/Transforms/TriangleResampler.cs index 0fde54486..57d1fa11d 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/TriangleResampler.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/TriangleResampler.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing.Transforms.Resamplers +namespace SixLabors.ImageSharp.Processing.Processors.Transforms { /// /// The function implements the triangle (bilinear) algorithm. diff --git a/src/ImageSharp/Processing/Transforms/Processors/WeightsBuffer.cs b/src/ImageSharp/Processing/Processors/Transforms/WeightsBuffer.cs similarity index 96% rename from src/ImageSharp/Processing/Transforms/Processors/WeightsBuffer.cs rename to src/ImageSharp/Processing/Processors/Transforms/WeightsBuffer.cs index 8c479992e..581a3353a 100644 --- a/src/ImageSharp/Processing/Transforms/Processors/WeightsBuffer.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/WeightsBuffer.cs @@ -4,7 +4,7 @@ using System; using SixLabors.Memory; -namespace SixLabors.ImageSharp.Processing.Transforms.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Transforms { /// /// Holds the values in an optimized contigous memory region. diff --git a/src/ImageSharp/Processing/Transforms/Processors/WeightsWindow.cs b/src/ImageSharp/Processing/Processors/Transforms/WeightsWindow.cs similarity index 98% rename from src/ImageSharp/Processing/Transforms/Processors/WeightsWindow.cs rename to src/ImageSharp/Processing/Processors/Transforms/WeightsWindow.cs index 440b19ecc..ebf2db4bf 100644 --- a/src/ImageSharp/Processing/Transforms/Processors/WeightsWindow.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/WeightsWindow.cs @@ -7,7 +7,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using SixLabors.Memory; -namespace SixLabors.ImageSharp.Processing.Transforms.Processors +namespace SixLabors.ImageSharp.Processing.Processors.Transforms { /// /// Points to a collection of of weights allocated in . diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/WelchResampler.cs b/src/ImageSharp/Processing/Processors/Transforms/WelchResampler.cs similarity index 91% rename from src/ImageSharp/Processing/Transforms/Resamplers/WelchResampler.cs rename to src/ImageSharp/Processing/Processors/Transforms/WelchResampler.cs index 01a07fed5..edce5fcf9 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/WelchResampler.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/WelchResampler.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing.Transforms.Resamplers +namespace SixLabors.ImageSharp.Processing.Processors.Transforms { /// /// The function implements the welch algorithm. diff --git a/src/ImageSharp/Processing/Transforms/ProjectiveTransformHelper.cs b/src/ImageSharp/Processing/ProjectiveTransformHelper.cs similarity index 99% rename from src/ImageSharp/Processing/Transforms/ProjectiveTransformHelper.cs rename to src/ImageSharp/Processing/ProjectiveTransformHelper.cs index 7c79776d9..4057ec586 100644 --- a/src/ImageSharp/Processing/Transforms/ProjectiveTransformHelper.cs +++ b/src/ImageSharp/Processing/ProjectiveTransformHelper.cs @@ -4,7 +4,7 @@ using System.Numerics; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Transforms +namespace SixLabors.ImageSharp.Processing { /// /// Enumerates the various options which determine which side to taper diff --git a/src/ImageSharp/Processing/Quantization/QuantizeExtensions.cs b/src/ImageSharp/Processing/QuantizeExtensions.cs similarity index 92% rename from src/ImageSharp/Processing/Quantization/QuantizeExtensions.cs rename to src/ImageSharp/Processing/QuantizeExtensions.cs index bf49c765a..5bd2f49bd 100644 --- a/src/ImageSharp/Processing/Quantization/QuantizeExtensions.cs +++ b/src/ImageSharp/Processing/QuantizeExtensions.cs @@ -2,9 +2,9 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Quantization.Processors; +using SixLabors.ImageSharp.Processing.Processors.Quantization; -namespace SixLabors.ImageSharp.Processing.Quantization +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the application of quantizing algorithms to the type. diff --git a/src/ImageSharp/Processing/Transforms/ResizeExtensions.cs b/src/ImageSharp/Processing/ResizeExtensions.cs similarity index 98% rename from src/ImageSharp/Processing/Transforms/ResizeExtensions.cs rename to src/ImageSharp/Processing/ResizeExtensions.cs index 4317c1fc1..8a370db69 100644 --- a/src/ImageSharp/Processing/Transforms/ResizeExtensions.cs +++ b/src/ImageSharp/Processing/ResizeExtensions.cs @@ -2,11 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Transforms.Processors; -using SixLabors.ImageSharp.Processing.Transforms.Resamplers; +using SixLabors.ImageSharp.Processing.Processors.Transforms; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Transforms +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the application of resize operations to the type. diff --git a/src/ImageSharp/Processing/Transforms/ResizeHelper.cs b/src/ImageSharp/Processing/ResizeHelper.cs similarity index 99% rename from src/ImageSharp/Processing/Transforms/ResizeHelper.cs rename to src/ImageSharp/Processing/ResizeHelper.cs index aca9d97d3..b9233937b 100644 --- a/src/ImageSharp/Processing/Transforms/ResizeHelper.cs +++ b/src/ImageSharp/Processing/ResizeHelper.cs @@ -5,7 +5,7 @@ using System; using System.Linq; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Transforms +namespace SixLabors.ImageSharp.Processing { /// /// Provides methods to help calculate the target rectangle when resizing using the diff --git a/src/ImageSharp/Processing/Transforms/ResizeMode.cs b/src/ImageSharp/Processing/ResizeMode.cs similarity index 96% rename from src/ImageSharp/Processing/Transforms/ResizeMode.cs rename to src/ImageSharp/Processing/ResizeMode.cs index 2707b11b3..6adeac66d 100644 --- a/src/ImageSharp/Processing/Transforms/ResizeMode.cs +++ b/src/ImageSharp/Processing/ResizeMode.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing.Transforms +namespace SixLabors.ImageSharp.Processing { /// /// Provides enumeration over how the image should be resized. diff --git a/src/ImageSharp/Processing/Transforms/ResizeOptions.cs b/src/ImageSharp/Processing/ResizeOptions.cs similarity index 92% rename from src/ImageSharp/Processing/Transforms/ResizeOptions.cs rename to src/ImageSharp/Processing/ResizeOptions.cs index c14abe2a8..0d5bfe38b 100644 --- a/src/ImageSharp/Processing/Transforms/ResizeOptions.cs +++ b/src/ImageSharp/Processing/ResizeOptions.cs @@ -3,10 +3,10 @@ using System.Collections.Generic; using System.Linq; -using SixLabors.ImageSharp.Processing.Transforms.Resamplers; +using SixLabors.ImageSharp.Processing.Processors.Transforms; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Transforms +namespace SixLabors.ImageSharp.Processing { /// /// The resize options for resizing images against certain modes. diff --git a/src/ImageSharp/Processing/Transforms/RotateExtensions.cs b/src/ImageSharp/Processing/RotateExtensions.cs similarity index 93% rename from src/ImageSharp/Processing/Transforms/RotateExtensions.cs rename to src/ImageSharp/Processing/RotateExtensions.cs index 28819099e..398a634d1 100644 --- a/src/ImageSharp/Processing/Transforms/RotateExtensions.cs +++ b/src/ImageSharp/Processing/RotateExtensions.cs @@ -2,10 +2,9 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Transforms.Processors; -using SixLabors.ImageSharp.Processing.Transforms.Resamplers; +using SixLabors.ImageSharp.Processing.Processors.Transforms; -namespace SixLabors.ImageSharp.Processing.Transforms +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the application of rotate operations to the type. diff --git a/src/ImageSharp/Processing/Transforms/RotateFlipExtensions.cs b/src/ImageSharp/Processing/RotateFlipExtensions.cs similarity index 95% rename from src/ImageSharp/Processing/Transforms/RotateFlipExtensions.cs rename to src/ImageSharp/Processing/RotateFlipExtensions.cs index 66bb27b36..27ddc8de9 100644 --- a/src/ImageSharp/Processing/Transforms/RotateFlipExtensions.cs +++ b/src/ImageSharp/Processing/RotateFlipExtensions.cs @@ -3,7 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Transforms +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the application of rotate-flip operations to the type. diff --git a/src/ImageSharp/Processing/Transforms/RotateMode.cs b/src/ImageSharp/Processing/RotateMode.cs similarity index 92% rename from src/ImageSharp/Processing/Transforms/RotateMode.cs rename to src/ImageSharp/Processing/RotateMode.cs index 6f66d0c09..c890f2bd6 100644 --- a/src/ImageSharp/Processing/Transforms/RotateMode.cs +++ b/src/ImageSharp/Processing/RotateMode.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing.Transforms +namespace SixLabors.ImageSharp.Processing { /// /// Provides enumeration over how the image should be rotated. diff --git a/src/ImageSharp/Processing/Filters/SaturateExtensions.cs b/src/ImageSharp/Processing/SaturateExtensions.cs similarity index 95% rename from src/ImageSharp/Processing/Filters/SaturateExtensions.cs rename to src/ImageSharp/Processing/SaturateExtensions.cs index 282bdef64..ba45ae12c 100644 --- a/src/ImageSharp/Processing/Filters/SaturateExtensions.cs +++ b/src/ImageSharp/Processing/SaturateExtensions.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Filters.Processors; +using SixLabors.ImageSharp.Processing.Processors.Filters; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Filters +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the alteration of the saturation component to the type. diff --git a/src/ImageSharp/Processing/Filters/SepiaExtensions.cs b/src/ImageSharp/Processing/SepiaExtensions.cs similarity index 96% rename from src/ImageSharp/Processing/Filters/SepiaExtensions.cs rename to src/ImageSharp/Processing/SepiaExtensions.cs index 09d8c3684..08676ee62 100644 --- a/src/ImageSharp/Processing/Filters/SepiaExtensions.cs +++ b/src/ImageSharp/Processing/SepiaExtensions.cs @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Filters.Processors; +using SixLabors.ImageSharp.Processing.Processors.Filters; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Filters +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the application of sepia toning to the type. diff --git a/src/ImageSharp/Processing/Transforms/SkewExtensions.cs b/src/ImageSharp/Processing/SkewExtensions.cs similarity index 92% rename from src/ImageSharp/Processing/Transforms/SkewExtensions.cs rename to src/ImageSharp/Processing/SkewExtensions.cs index cbb414888..07e3c6087 100644 --- a/src/ImageSharp/Processing/Transforms/SkewExtensions.cs +++ b/src/ImageSharp/Processing/SkewExtensions.cs @@ -2,10 +2,9 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Transforms.Processors; -using SixLabors.ImageSharp.Processing.Transforms.Resamplers; +using SixLabors.ImageSharp.Processing.Processors.Transforms; -namespace SixLabors.ImageSharp.Processing.Transforms +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the application of skew operations to the type. diff --git a/src/ImageSharp/Processing/Transforms/TransformExtensions.cs b/src/ImageSharp/Processing/TransformExtensions.cs similarity index 97% rename from src/ImageSharp/Processing/Transforms/TransformExtensions.cs rename to src/ImageSharp/Processing/TransformExtensions.cs index 2607c102b..0ec1e295d 100644 --- a/src/ImageSharp/Processing/Transforms/TransformExtensions.cs +++ b/src/ImageSharp/Processing/TransformExtensions.cs @@ -3,11 +3,10 @@ using System.Numerics; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Transforms.Processors; -using SixLabors.ImageSharp.Processing.Transforms.Resamplers; +using SixLabors.ImageSharp.Processing.Processors.Transforms; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Transforms +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the application of composable transform operations to the type. diff --git a/src/ImageSharp/Processing/Overlays/VignetteExtensions.cs b/src/ImageSharp/Processing/VignetteExtensions.cs similarity index 98% rename from src/ImageSharp/Processing/Overlays/VignetteExtensions.cs rename to src/ImageSharp/Processing/VignetteExtensions.cs index 25b067d7f..18dd8064c 100644 --- a/src/ImageSharp/Processing/Overlays/VignetteExtensions.cs +++ b/src/ImageSharp/Processing/VignetteExtensions.cs @@ -3,10 +3,10 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Primitives; -using SixLabors.ImageSharp.Processing.Overlays.Processors; +using SixLabors.ImageSharp.Processing.Processors.Overlays; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Overlays +namespace SixLabors.ImageSharp.Processing { /// /// Adds extensions that allow the application of a radial glow to the type. diff --git a/tests/ImageSharp.Benchmarks/Codecs/EncodeGif.cs b/tests/ImageSharp.Benchmarks/Codecs/EncodeGif.cs index 4f5bcdf0a..12e74ccdb 100644 --- a/tests/ImageSharp.Benchmarks/Codecs/EncodeGif.cs +++ b/tests/ImageSharp.Benchmarks/Codecs/EncodeGif.cs @@ -6,7 +6,7 @@ using System.IO; using BenchmarkDotNet.Attributes; using SixLabors.ImageSharp.Formats.Gif; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Quantization; +using SixLabors.ImageSharp.Processing.Processors.Quantization; using SixLabors.ImageSharp.Tests; using SDImage = System.Drawing.Image; diff --git a/tests/ImageSharp.Benchmarks/Codecs/EncodeGifMultiple.cs b/tests/ImageSharp.Benchmarks/Codecs/EncodeGifMultiple.cs index cf94a1ec3..9b94347f3 100644 --- a/tests/ImageSharp.Benchmarks/Codecs/EncodeGifMultiple.cs +++ b/tests/ImageSharp.Benchmarks/Codecs/EncodeGifMultiple.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.Drawing.Imaging; using BenchmarkDotNet.Attributes; using SixLabors.ImageSharp.Formats.Gif; -using SixLabors.ImageSharp.Processing.Quantization; +using SixLabors.ImageSharp.Processing.Processors.Quantization; namespace SixLabors.ImageSharp.Benchmarks.Codecs { diff --git a/tests/ImageSharp.Benchmarks/Codecs/EncodeIndexedPng.cs b/tests/ImageSharp.Benchmarks/Codecs/EncodeIndexedPng.cs index db415d3c2..962b34eb7 100644 --- a/tests/ImageSharp.Benchmarks/Codecs/EncodeIndexedPng.cs +++ b/tests/ImageSharp.Benchmarks/Codecs/EncodeIndexedPng.cs @@ -5,7 +5,8 @@ using System.IO; using BenchmarkDotNet.Attributes; using SixLabors.ImageSharp.Formats.Png; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Quantization; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Quantization; using SixLabors.ImageSharp.Tests; using CoreImage = SixLabors.ImageSharp.Image; diff --git a/tests/ImageSharp.Benchmarks/Codecs/Jpeg/DecodeJpegParseStreamOnly.cs b/tests/ImageSharp.Benchmarks/Codecs/Jpeg/DecodeJpegParseStreamOnly.cs new file mode 100644 index 000000000..059f312b3 --- /dev/null +++ b/tests/ImageSharp.Benchmarks/Codecs/Jpeg/DecodeJpegParseStreamOnly.cs @@ -0,0 +1,52 @@ +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using BenchmarkDotNet.Attributes; +using System.Drawing; +using System.IO; +using SixLabors.ImageSharp.Formats.Jpeg; +using SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort; +using SixLabors.ImageSharp.Tests; + +namespace SixLabors.ImageSharp.Benchmarks.Codecs.Jpeg +{ + [Config(typeof(Config.ShortClr))] + public class DecodeJpegParseStreamOnly + { + [Params(TestImages.Jpeg.Baseline.Jpeg420Exif)] + public string TestImage { get; set; } + + private string TestImageFullPath => Path.Combine(TestEnvironment.InputImagesDirectoryFullPath, this.TestImage); + + private byte[] jpegBytes; + + [GlobalSetup] + public void Setup() + { + this.jpegBytes = File.ReadAllBytes(this.TestImageFullPath); + } + + [Benchmark(Baseline = true, Description = "System.Drawing FULL")] + public Size JpegSystemDrawing() + { + using (var memoryStream = new MemoryStream(this.jpegBytes)) + { + using (var image = System.Drawing.Image.FromStream(memoryStream)) + { + return image.Size; + } + } + } + + [Benchmark(Description = "PdfJsJpegDecoderCore.ParseStream")] + public void ParseStreamPdfJs() + { + using (var memoryStream = new MemoryStream(this.jpegBytes)) + { + var decoder = new PdfJsJpegDecoderCore(Configuration.Default, new JpegDecoder() { IgnoreMetadata = true }); + decoder.ParseStream(memoryStream); + decoder.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Benchmarks/Drawing/DrawBeziers.cs b/tests/ImageSharp.Benchmarks/Drawing/DrawBeziers.cs index d2f54f140..edbbceb62 100644 --- a/tests/ImageSharp.Benchmarks/Drawing/DrawBeziers.cs +++ b/tests/ImageSharp.Benchmarks/Drawing/DrawBeziers.cs @@ -11,7 +11,6 @@ using BenchmarkDotNet.Attributes; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Drawing; namespace SixLabors.ImageSharp.Benchmarks { diff --git a/tests/ImageSharp.Benchmarks/Drawing/DrawLines.cs b/tests/ImageSharp.Benchmarks/Drawing/DrawLines.cs index a027108a1..894683599 100644 --- a/tests/ImageSharp.Benchmarks/Drawing/DrawLines.cs +++ b/tests/ImageSharp.Benchmarks/Drawing/DrawLines.cs @@ -3,8 +3,6 @@ // Licensed under the Apache License, Version 2.0. // -using SixLabors.ImageSharp.Processing.Drawing; - namespace SixLabors.ImageSharp.Benchmarks { using System.Drawing; diff --git a/tests/ImageSharp.Benchmarks/Drawing/DrawPolygon.cs b/tests/ImageSharp.Benchmarks/Drawing/DrawPolygon.cs index ab690f645..5fbd9f112 100644 --- a/tests/ImageSharp.Benchmarks/Drawing/DrawPolygon.cs +++ b/tests/ImageSharp.Benchmarks/Drawing/DrawPolygon.cs @@ -11,13 +11,9 @@ using System.Numerics; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Drawing; -using SixLabors.ImageSharp.Processing.Overlays; namespace SixLabors.ImageSharp.Benchmarks { - - public class DrawPolygon : BenchmarkBase { [Benchmark(Baseline = true, Description = "System.Drawing Draw Polygon")] diff --git a/tests/ImageSharp.Benchmarks/Drawing/DrawText.cs b/tests/ImageSharp.Benchmarks/Drawing/DrawText.cs index 96912a6df..624b54278 100644 --- a/tests/ImageSharp.Benchmarks/Drawing/DrawText.cs +++ b/tests/ImageSharp.Benchmarks/Drawing/DrawText.cs @@ -6,15 +6,11 @@ using System.Drawing; using System.Drawing.Drawing2D; using BenchmarkDotNet.Attributes; -using System.IO; -using System.Numerics; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Text; -using SixLabors.ImageSharp.Processing.Overlays; -using SixLabors.ImageSharp.Processing.Drawing; using System.Linq; +using SixLabors.ImageSharp.Processing.Processors.Text; namespace SixLabors.ImageSharp.Benchmarks { @@ -24,9 +20,9 @@ namespace SixLabors.ImageSharp.Benchmarks { [Params(10, 100)] - public int TextIterations{ get; set; } + public int TextIterations { get; set; } public string TextPhrase { get; set; } = "Hello World"; - public string TextToRender => string.Join(" ", Enumerable.Repeat(TextPhrase, TextIterations)); + public string TextToRender => string.Join(" ", Enumerable.Repeat(this.TextPhrase, this.TextIterations)); [Benchmark(Baseline = true, Description = "System.Drawing Draw Text")] @@ -41,7 +37,7 @@ namespace SixLabors.ImageSharp.Benchmarks graphics.SmoothingMode = SmoothingMode.AntiAlias; Pen pen = new Pen(System.Drawing.Color.HotPink, 10); var font = new Font("Arial", 12, GraphicsUnit.Point); - graphics.DrawString(TextToRender, font, Brushes.HotPink, new RectangleF(10, 10, 780, 780)); + graphics.DrawString(TextToRender, font, System.Drawing.Brushes.HotPink, new RectangleF(10, 10, 780, 780)); } } } @@ -53,7 +49,7 @@ namespace SixLabors.ImageSharp.Benchmarks using (Image image = new Image(800, 800)) { var font = SixLabors.Fonts.SystemFonts.CreateFont("Arial", 12); - image.Mutate(x => x.ApplyProcessor(new SixLabors.ImageSharp.Processing.Text.Processors.DrawTextProcessor(new TextGraphicsOptions(true) { WrapTextWidth = 780 }, TextToRender, font, SixLabors.ImageSharp.Processing.Drawing.Brushes.Brushes.Solid(Rgba32.HotPink), null, new SixLabors.Primitives.PointF(10, 10)))); + image.Mutate(x => x.ApplyProcessor(new DrawTextProcessor(new TextGraphicsOptions(true) { WrapTextWidth = 780 }, TextToRender, font, Processing.Brushes.Solid(Rgba32.HotPink), null, new SixLabors.Primitives.PointF(10, 10)))); } } @@ -63,10 +59,10 @@ namespace SixLabors.ImageSharp.Benchmarks using (Image image = new Image(800, 800)) { var font = SixLabors.Fonts.SystemFonts.CreateFont("Arial", 12); - image.Mutate(x => DrawTextOldVersion(x, new TextGraphicsOptions(true) { WrapTextWidth = 780 }, TextToRender, font, SixLabors.ImageSharp.Processing.Drawing.Brushes.Brushes.Solid(Rgba32.HotPink), null, new SixLabors.Primitives.PointF(10, 10))); + image.Mutate(x => DrawTextOldVersion(x, new TextGraphicsOptions(true) { WrapTextWidth = 780 }, TextToRender, font, Processing.Brushes.Solid(Rgba32.HotPink), null, new SixLabors.Primitives.PointF(10, 10))); } - IImageProcessingContext DrawTextOldVersion(IImageProcessingContext source, TextGraphicsOptions options, string text, SixLabors.Fonts.Font font, SixLabors.ImageSharp.Processing.Drawing.Brushes.IBrush brush, SixLabors.ImageSharp.Processing.Drawing.Pens.IPen pen, SixLabors.Primitives.PointF location) + IImageProcessingContext DrawTextOldVersion(IImageProcessingContext source, TextGraphicsOptions options, string text, SixLabors.Fonts.Font font, IBrush brush, IPen pen, SixLabors.Primitives.PointF location) where TPixel : struct, IPixel { float dpiX = 72; diff --git a/tests/ImageSharp.Benchmarks/Drawing/DrawTextOutline.cs b/tests/ImageSharp.Benchmarks/Drawing/DrawTextOutline.cs index e85e33235..ba6d055e3 100644 --- a/tests/ImageSharp.Benchmarks/Drawing/DrawTextOutline.cs +++ b/tests/ImageSharp.Benchmarks/Drawing/DrawTextOutline.cs @@ -6,15 +6,10 @@ using System.Drawing; using System.Drawing.Drawing2D; using BenchmarkDotNet.Attributes; -using System.IO; -using System.Numerics; - using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Text; -using SixLabors.ImageSharp.Processing.Overlays; -using SixLabors.ImageSharp.Processing.Drawing; using System.Linq; +using SixLabors.ImageSharp.Processing.Processors.Text; namespace SixLabors.ImageSharp.Benchmarks { @@ -24,7 +19,7 @@ namespace SixLabors.ImageSharp.Benchmarks { [Params(10, 100)] - public int TextIterations{ get; set; } + public int TextIterations { get; set; } public string TextPhrase { get; set; } = "Hello World"; public string TextToRender => string.Join(" ", Enumerable.Repeat(TextPhrase, TextIterations)); @@ -54,7 +49,7 @@ namespace SixLabors.ImageSharp.Benchmarks using (Image image = new Image(800, 800)) { var font = SixLabors.Fonts.SystemFonts.CreateFont("Arial", 12); - image.Mutate(x => x.ApplyProcessor(new SixLabors.ImageSharp.Processing.Text.Processors.DrawTextProcessor(new TextGraphicsOptions(true) { WrapTextWidth = 780 }, TextToRender, font, null, SixLabors.ImageSharp.Processing.Drawing.Pens.Pens.Solid(Rgba32.HotPink, 10), new SixLabors.Primitives.PointF(10, 10)))); + image.Mutate(x => x.ApplyProcessor(new DrawTextProcessor(new TextGraphicsOptions(true) { WrapTextWidth = 780 }, TextToRender, font, null, Processing.Pens.Solid(Rgba32.HotPink, 10), new SixLabors.Primitives.PointF(10, 10)))); } } @@ -64,10 +59,10 @@ namespace SixLabors.ImageSharp.Benchmarks using (Image image = new Image(800, 800)) { var font = SixLabors.Fonts.SystemFonts.CreateFont("Arial", 12); - image.Mutate(x => DrawTextOldVersion(x, new TextGraphicsOptions(true) { WrapTextWidth = 780 }, TextToRender, font, null, SixLabors.ImageSharp.Processing.Drawing.Pens.Pens.Solid(Rgba32.HotPink, 10), new SixLabors.Primitives.PointF(10, 10))); + image.Mutate(x => DrawTextOldVersion(x, new TextGraphicsOptions(true) { WrapTextWidth = 780 }, TextToRender, font, null, Processing.Pens.Solid(Rgba32.HotPink, 10), new SixLabors.Primitives.PointF(10, 10))); } - IImageProcessingContext DrawTextOldVersion(IImageProcessingContext source, TextGraphicsOptions options, string text, SixLabors.Fonts.Font font, SixLabors.ImageSharp.Processing.Drawing.Brushes.IBrush brush, SixLabors.ImageSharp.Processing.Drawing.Pens.IPen pen, SixLabors.Primitives.PointF location) + IImageProcessingContext DrawTextOldVersion(IImageProcessingContext source, TextGraphicsOptions options, string text, SixLabors.Fonts.Font font, IBrush brush, IPen pen, SixLabors.Primitives.PointF location) where TPixel : struct, IPixel { var style = new SixLabors.Fonts.RendererOptions(font, options.DpiX, options.DpiY, location) diff --git a/tests/ImageSharp.Benchmarks/Drawing/FillPolygon.cs b/tests/ImageSharp.Benchmarks/Drawing/FillPolygon.cs index c53a97515..8aadb85bf 100644 --- a/tests/ImageSharp.Benchmarks/Drawing/FillPolygon.cs +++ b/tests/ImageSharp.Benchmarks/Drawing/FillPolygon.cs @@ -12,8 +12,6 @@ using BenchmarkDotNet.Attributes; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Drawing; -using SixLabors.ImageSharp.Processing.Overlays; namespace SixLabors.ImageSharp.Benchmarks { @@ -37,7 +35,7 @@ namespace SixLabors.ImageSharp.Benchmarks using (Graphics graphics = Graphics.FromImage(destination)) { graphics.SmoothingMode = SmoothingMode.AntiAlias; - graphics.FillPolygon(Brushes.HotPink, + graphics.FillPolygon(System.Drawing.Brushes.HotPink, new[] { new Point(10, 10), diff --git a/tests/ImageSharp.Benchmarks/Drawing/FillRectangle.cs b/tests/ImageSharp.Benchmarks/Drawing/FillRectangle.cs index 7bd55e905..643e4ac9a 100644 --- a/tests/ImageSharp.Benchmarks/Drawing/FillRectangle.cs +++ b/tests/ImageSharp.Benchmarks/Drawing/FillRectangle.cs @@ -10,8 +10,6 @@ using BenchmarkDotNet.Attributes; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Drawing; -using SixLabors.ImageSharp.Processing.Overlays; using CoreRectangle = SixLabors.Primitives.Rectangle; using CoreSize = SixLabors.Primitives.Size; @@ -31,7 +29,7 @@ namespace SixLabors.ImageSharp.Benchmarks { graphics.InterpolationMode = InterpolationMode.Default; graphics.SmoothingMode = SmoothingMode.AntiAlias; - graphics.FillRectangle(Brushes.HotPink, new Rectangle(10, 10, 190, 140)); + graphics.FillRectangle(System.Drawing.Brushes.HotPink, new Rectangle(10, 10, 190, 140)); } return destination.Size; } diff --git a/tests/ImageSharp.Benchmarks/Drawing/FillWithPattern.cs b/tests/ImageSharp.Benchmarks/Drawing/FillWithPattern.cs index 059398c6c..5f8f2ff06 100644 --- a/tests/ImageSharp.Benchmarks/Drawing/FillWithPattern.cs +++ b/tests/ImageSharp.Benchmarks/Drawing/FillWithPattern.cs @@ -11,15 +11,11 @@ using BenchmarkDotNet.Attributes; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Drawing; - -using CoreBrushes = SixLabors.ImageSharp.Processing.Drawing.Brushes.Brushes; +using CoreBrushes = SixLabors.ImageSharp.Processing.Brushes; namespace SixLabors.ImageSharp.Benchmarks { - - public class FillWithPattern { [Benchmark(Baseline = true, Description = "System.Drawing Fill with Pattern")] @@ -30,7 +26,7 @@ namespace SixLabors.ImageSharp.Benchmarks using (Graphics graphics = Graphics.FromImage(destination)) { graphics.SmoothingMode = SmoothingMode.AntiAlias; - HatchBrush brush = new HatchBrush(HatchStyle.BackwardDiagonal, System.Drawing.Color.HotPink); + HatchBrush brush = new HatchBrush(HatchStyle.BackwardDiagonal, Color.HotPink); graphics.FillRectangle(brush, new Rectangle(0, 0, 800, 800)); // can't find a way to flood fill with a brush } using (MemoryStream ms = new MemoryStream()) diff --git a/tests/ImageSharp.Benchmarks/Samplers/Crop.cs b/tests/ImageSharp.Benchmarks/Samplers/Crop.cs index d5ac6a6f1..240a277cf 100644 --- a/tests/ImageSharp.Benchmarks/Samplers/Crop.cs +++ b/tests/ImageSharp.Benchmarks/Samplers/Crop.cs @@ -12,7 +12,6 @@ namespace SixLabors.ImageSharp.Benchmarks using BenchmarkDotNet.Attributes; using SixLabors.ImageSharp.Processing; - using SixLabors.ImageSharp.Processing.Transforms; using CoreSize = SixLabors.Primitives.Size; diff --git a/tests/ImageSharp.Benchmarks/Samplers/DetectEdges.cs b/tests/ImageSharp.Benchmarks/Samplers/DetectEdges.cs index 569b5bc44..006d1b639 100644 --- a/tests/ImageSharp.Benchmarks/Samplers/DetectEdges.cs +++ b/tests/ImageSharp.Benchmarks/Samplers/DetectEdges.cs @@ -12,7 +12,6 @@ namespace SixLabors.ImageSharp.Benchmarks using BenchmarkDotNet.Attributes; using SixLabors.ImageSharp.Processing; - using SixLabors.ImageSharp.Processing.Convolution; using CoreImage = ImageSharp.Image; diff --git a/tests/ImageSharp.Benchmarks/Samplers/Glow.cs b/tests/ImageSharp.Benchmarks/Samplers/Glow.cs index ce17481c4..85c4fdd7c 100644 --- a/tests/ImageSharp.Benchmarks/Samplers/Glow.cs +++ b/tests/ImageSharp.Benchmarks/Samplers/Glow.cs @@ -16,7 +16,7 @@ namespace SixLabors.ImageSharp.Benchmarks using SixLabors.Memory; using SixLabors.Primitives; - using SixLabors.ImageSharp.Processing.Overlays.Processors; + using SixLabors.ImageSharp.Processing.Processors.Overlays; using SixLabors.ImageSharp.Processing.Processors; public class Glow : BenchmarkBase diff --git a/tests/ImageSharp.Benchmarks/Samplers/Resize.cs b/tests/ImageSharp.Benchmarks/Samplers/Resize.cs index 0a4730686..8bba227c5 100644 --- a/tests/ImageSharp.Benchmarks/Samplers/Resize.cs +++ b/tests/ImageSharp.Benchmarks/Samplers/Resize.cs @@ -12,7 +12,6 @@ namespace SixLabors.ImageSharp.Benchmarks using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; - using SixLabors.ImageSharp.Processing.Transforms; using CoreSize = SixLabors.Primitives.Size; diff --git a/tests/ImageSharp.Tests/ComplexIntegrationTests.cs b/tests/ImageSharp.Tests/ComplexIntegrationTests.cs index ed4bb6104..a260ec33c 100644 --- a/tests/ImageSharp.Tests/ComplexIntegrationTests.cs +++ b/tests/ImageSharp.Tests/ComplexIntegrationTests.cs @@ -1,6 +1,6 @@ using SixLabors.ImageSharp.Formats.Jpeg; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Transforms; +using SixLabors.ImageSharp.Processing; using SixLabors.Primitives; using Xunit; diff --git a/tests/ImageSharp.Tests/Drawing/BeziersTests.cs b/tests/ImageSharp.Tests/Drawing/BeziersTests.cs index a5fda7958..443b49c7c 100644 --- a/tests/ImageSharp.Tests/Drawing/BeziersTests.cs +++ b/tests/ImageSharp.Tests/Drawing/BeziersTests.cs @@ -5,8 +5,6 @@ using System.Numerics; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Drawing; -using SixLabors.ImageSharp.Processing.Overlays; using SixLabors.Memory; using Xunit; diff --git a/tests/ImageSharp.Tests/Drawing/DrawImageTest.cs b/tests/ImageSharp.Tests/Drawing/DrawImageTest.cs index d0087b1d2..40ad92adc 100644 --- a/tests/ImageSharp.Tests/Drawing/DrawImageTest.cs +++ b/tests/ImageSharp.Tests/Drawing/DrawImageTest.cs @@ -5,13 +5,13 @@ using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Drawing; using SixLabors.Primitives; using Xunit; namespace SixLabors.ImageSharp.Tests { - using SixLabors.ImageSharp.Processing.Transforms; + using SixLabors.ImageSharp.Processing; + using SixLabors.ImageSharp.Processing.Processors.Transforms; public class DrawImageTest : FileTestBase { diff --git a/tests/ImageSharp.Tests/Drawing/DrawPathTests.cs b/tests/ImageSharp.Tests/Drawing/DrawPathTests.cs index c1865e930..96af63fd5 100644 --- a/tests/ImageSharp.Tests/Drawing/DrawPathTests.cs +++ b/tests/ImageSharp.Tests/Drawing/DrawPathTests.cs @@ -4,9 +4,6 @@ using System.Numerics; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Drawing; -using SixLabors.ImageSharp.Processing.Drawing.Pens; -using SixLabors.ImageSharp.Processing.Overlays; using SixLabors.Shapes; using Xunit; diff --git a/tests/ImageSharp.Tests/Drawing/FillEllipticGradientBrushTest.cs b/tests/ImageSharp.Tests/Drawing/FillEllipticGradientBrushTest.cs index 7c9fa2088..fa4d4a709 100644 --- a/tests/ImageSharp.Tests/Drawing/FillEllipticGradientBrushTest.cs +++ b/tests/ImageSharp.Tests/Drawing/FillEllipticGradientBrushTest.cs @@ -5,8 +5,6 @@ using System; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Drawing; -using SixLabors.ImageSharp.Processing.Drawing.Brushes.GradientBrushes; using Xunit; diff --git a/tests/ImageSharp.Tests/Drawing/FillLinearGradientBrushTests.cs b/tests/ImageSharp.Tests/Drawing/FillLinearGradientBrushTests.cs index 9e7af1e57..3522ade7c 100644 --- a/tests/ImageSharp.Tests/Drawing/FillLinearGradientBrushTests.cs +++ b/tests/ImageSharp.Tests/Drawing/FillLinearGradientBrushTests.cs @@ -8,8 +8,6 @@ using System.Text; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Drawing; -using SixLabors.ImageSharp.Processing.Drawing.Brushes.GradientBrushes; using Xunit; // ReSharper disable InconsistentNaming diff --git a/tests/ImageSharp.Tests/Drawing/FillPatternTests.cs b/tests/ImageSharp.Tests/Drawing/FillPatternTests.cs index 29b78220d..f13f808b6 100644 --- a/tests/ImageSharp.Tests/Drawing/FillPatternTests.cs +++ b/tests/ImageSharp.Tests/Drawing/FillPatternTests.cs @@ -5,15 +5,11 @@ using System; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Primitives; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Drawing; -using SixLabors.ImageSharp.Processing.Drawing.Brushes; -using SixLabors.ImageSharp.Processing.Transforms; +using SixLabors.Memory; using Xunit; namespace SixLabors.ImageSharp.Tests.Drawing { - using SixLabors.Memory; - public class FillPatternBrushTests : FileTestBase { private void Test(string name, Rgba32 background, IBrush brush, Rgba32[,] expectedPattern) diff --git a/tests/ImageSharp.Tests/Drawing/FillRadialGradientBrushTests.cs b/tests/ImageSharp.Tests/Drawing/FillRadialGradientBrushTests.cs index eafbf3df1..7461347de 100644 --- a/tests/ImageSharp.Tests/Drawing/FillRadialGradientBrushTests.cs +++ b/tests/ImageSharp.Tests/Drawing/FillRadialGradientBrushTests.cs @@ -1,13 +1,10 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Drawing; -using SixLabors.ImageSharp.Processing.Drawing.Brushes.GradientBrushes; using Xunit; namespace SixLabors.ImageSharp.Tests.Drawing { - using System; using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison; diff --git a/tests/ImageSharp.Tests/Drawing/FillRegionProcessorTests.cs b/tests/ImageSharp.Tests/Drawing/FillRegionProcessorTests.cs index c664bcf9c..dc7da3543 100644 --- a/tests/ImageSharp.Tests/Drawing/FillRegionProcessorTests.cs +++ b/tests/ImageSharp.Tests/Drawing/FillRegionProcessorTests.cs @@ -5,20 +5,16 @@ using System.Numerics; using Moq; using System; -using SixLabors.Memory; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Primitives; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Drawing; -using SixLabors.ImageSharp.Processing.Drawing.Brushes; -using SixLabors.ImageSharp.Processing.Drawing.Pens; -using SixLabors.ImageSharp.Processing.Drawing.Processors; using SixLabors.Primitives; using Xunit; +using SixLabors.ImageSharp.Processing.Processors.Drawing; namespace SixLabors.ImageSharp.Tests.Drawing { - + public class FillRegionProcessorTests { diff --git a/tests/ImageSharp.Tests/Drawing/FillSolidBrushTests.cs b/tests/ImageSharp.Tests/Drawing/FillSolidBrushTests.cs index 58fd4c767..1f01d54f4 100644 --- a/tests/ImageSharp.Tests/Drawing/FillSolidBrushTests.cs +++ b/tests/ImageSharp.Tests/Drawing/FillSolidBrushTests.cs @@ -3,9 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Drawing; using SixLabors.ImageSharp.Primitives; -using SixLabors.ImageSharp.Processing.Drawing.Brushes; using SixLabors.Shapes; using Xunit; // ReSharper disable InconsistentNaming diff --git a/tests/ImageSharp.Tests/Drawing/LineComplexPolygonTests.cs b/tests/ImageSharp.Tests/Drawing/LineComplexPolygonTests.cs index ecd1c06e8..d3b39709a 100644 --- a/tests/ImageSharp.Tests/Drawing/LineComplexPolygonTests.cs +++ b/tests/ImageSharp.Tests/Drawing/LineComplexPolygonTests.cs @@ -4,9 +4,6 @@ using System.Numerics; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Drawing; -using SixLabors.ImageSharp.Processing.Drawing.Pens; -using SixLabors.ImageSharp.Processing.Overlays; using SixLabors.Shapes; using Xunit; diff --git a/tests/ImageSharp.Tests/Drawing/LineTests.cs b/tests/ImageSharp.Tests/Drawing/LineTests.cs index 28b59746f..747c75cde 100644 --- a/tests/ImageSharp.Tests/Drawing/LineTests.cs +++ b/tests/ImageSharp.Tests/Drawing/LineTests.cs @@ -5,9 +5,6 @@ using System.Numerics; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Drawing; -using SixLabors.ImageSharp.Processing.Drawing.Pens; -using SixLabors.ImageSharp.Processing.Overlays; using Xunit; diff --git a/tests/ImageSharp.Tests/Drawing/Paths/DrawPathCollection.cs b/tests/ImageSharp.Tests/Drawing/Paths/DrawPathCollection.cs index ecdfd03e5..326517a4e 100644 --- a/tests/ImageSharp.Tests/Drawing/Paths/DrawPathCollection.cs +++ b/tests/ImageSharp.Tests/Drawing/Paths/DrawPathCollection.cs @@ -4,10 +4,8 @@ using System.Numerics; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Primitives; -using SixLabors.ImageSharp.Processing.Drawing; -using SixLabors.ImageSharp.Processing.Drawing.Brushes; -using SixLabors.ImageSharp.Processing.Drawing.Pens; -using SixLabors.ImageSharp.Processing.Drawing.Processors; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Drawing; using SixLabors.Shapes; using Xunit; diff --git a/tests/ImageSharp.Tests/Drawing/Paths/FillPath.cs b/tests/ImageSharp.Tests/Drawing/Paths/FillPath.cs index 1a402c5b7..e72fbbdf2 100644 --- a/tests/ImageSharp.Tests/Drawing/Paths/FillPath.cs +++ b/tests/ImageSharp.Tests/Drawing/Paths/FillPath.cs @@ -4,9 +4,8 @@ using System.Numerics; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Primitives; -using SixLabors.ImageSharp.Processing.Drawing; -using SixLabors.ImageSharp.Processing.Drawing.Brushes; -using SixLabors.ImageSharp.Processing.Drawing.Processors; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Drawing; using SixLabors.Shapes; using Xunit; diff --git a/tests/ImageSharp.Tests/Drawing/Paths/FillPathCollection.cs b/tests/ImageSharp.Tests/Drawing/Paths/FillPathCollection.cs index b728ea7bf..ec7a5a20c 100644 --- a/tests/ImageSharp.Tests/Drawing/Paths/FillPathCollection.cs +++ b/tests/ImageSharp.Tests/Drawing/Paths/FillPathCollection.cs @@ -4,9 +4,8 @@ using System.Numerics; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Primitives; -using SixLabors.ImageSharp.Processing.Drawing; -using SixLabors.ImageSharp.Processing.Drawing.Brushes; -using SixLabors.ImageSharp.Processing.Drawing.Processors; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Drawing; using SixLabors.Shapes; using Xunit; diff --git a/tests/ImageSharp.Tests/Drawing/Paths/FillPolygon.cs b/tests/ImageSharp.Tests/Drawing/Paths/FillPolygon.cs index 0c0fb58fa..d8927a468 100644 --- a/tests/ImageSharp.Tests/Drawing/Paths/FillPolygon.cs +++ b/tests/ImageSharp.Tests/Drawing/Paths/FillPolygon.cs @@ -4,9 +4,8 @@ using System.Numerics; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Primitives; -using SixLabors.ImageSharp.Processing.Drawing; -using SixLabors.ImageSharp.Processing.Drawing.Brushes; -using SixLabors.ImageSharp.Processing.Drawing.Processors; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Drawing; using SixLabors.Shapes; using Xunit; diff --git a/tests/ImageSharp.Tests/Drawing/Paths/FillRectangle.cs b/tests/ImageSharp.Tests/Drawing/Paths/FillRectangle.cs index 4c232b452..8f648e425 100644 --- a/tests/ImageSharp.Tests/Drawing/Paths/FillRectangle.cs +++ b/tests/ImageSharp.Tests/Drawing/Paths/FillRectangle.cs @@ -3,9 +3,8 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Primitives; -using SixLabors.ImageSharp.Processing.Drawing; -using SixLabors.ImageSharp.Processing.Drawing.Brushes; -using SixLabors.ImageSharp.Processing.Drawing.Processors; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Drawing; using Xunit; namespace SixLabors.ImageSharp.Tests.Drawing.Paths diff --git a/tests/ImageSharp.Tests/Drawing/PolygonTests.cs b/tests/ImageSharp.Tests/Drawing/PolygonTests.cs index c7a0531c9..f9a41baba 100644 --- a/tests/ImageSharp.Tests/Drawing/PolygonTests.cs +++ b/tests/ImageSharp.Tests/Drawing/PolygonTests.cs @@ -6,8 +6,6 @@ using System.Numerics; using SixLabors.ImageSharp.PixelFormats; using SixLabors.Primitives; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Drawing; -using SixLabors.ImageSharp.Processing.Overlays; using Xunit; namespace SixLabors.ImageSharp.Tests.Drawing diff --git a/tests/ImageSharp.Tests/Drawing/RecolorImageTest.cs b/tests/ImageSharp.Tests/Drawing/RecolorImageTest.cs index 6ce1e2da3..2dcd8b3d3 100644 --- a/tests/ImageSharp.Tests/Drawing/RecolorImageTest.cs +++ b/tests/ImageSharp.Tests/Drawing/RecolorImageTest.cs @@ -3,8 +3,6 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Drawing; -using SixLabors.ImageSharp.Processing.Drawing.Brushes; using SixLabors.Primitives; using Xunit; diff --git a/tests/ImageSharp.Tests/Drawing/SolidBezierTests.cs b/tests/ImageSharp.Tests/Drawing/SolidBezierTests.cs index 7175e7a65..94d3d49ff 100644 --- a/tests/ImageSharp.Tests/Drawing/SolidBezierTests.cs +++ b/tests/ImageSharp.Tests/Drawing/SolidBezierTests.cs @@ -4,8 +4,6 @@ using System.Numerics; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Drawing; -using SixLabors.ImageSharp.Processing.Overlays; using SixLabors.Shapes; using Xunit; diff --git a/tests/ImageSharp.Tests/Drawing/SolidComplexPolygonTests.cs b/tests/ImageSharp.Tests/Drawing/SolidComplexPolygonTests.cs index 42b0dc1e6..c8d3fe1bc 100644 --- a/tests/ImageSharp.Tests/Drawing/SolidComplexPolygonTests.cs +++ b/tests/ImageSharp.Tests/Drawing/SolidComplexPolygonTests.cs @@ -5,8 +5,6 @@ using System.Numerics; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Drawing; -using SixLabors.ImageSharp.Processing.Overlays; using SixLabors.Shapes; using Xunit; diff --git a/tests/ImageSharp.Tests/Drawing/SolidFillBlendedShapesTests.cs b/tests/ImageSharp.Tests/Drawing/SolidFillBlendedShapesTests.cs index 7d73d1b65..0c08f66c6 100644 --- a/tests/ImageSharp.Tests/Drawing/SolidFillBlendedShapesTests.cs +++ b/tests/ImageSharp.Tests/Drawing/SolidFillBlendedShapesTests.cs @@ -5,7 +5,6 @@ using System.Collections.Generic; using System.Linq; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Drawing; using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison; using SixLabors.Primitives; using Xunit; diff --git a/tests/ImageSharp.Tests/Drawing/SolidPolygonTests.cs b/tests/ImageSharp.Tests/Drawing/SolidPolygonTests.cs index b39cc4632..e42b4b481 100644 --- a/tests/ImageSharp.Tests/Drawing/SolidPolygonTests.cs +++ b/tests/ImageSharp.Tests/Drawing/SolidPolygonTests.cs @@ -6,9 +6,6 @@ using System.Numerics; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Drawing; -using SixLabors.ImageSharp.Processing.Drawing.Brushes; -using SixLabors.ImageSharp.Processing.Overlays; using SixLabors.Shapes; using Xunit; diff --git a/tests/ImageSharp.Tests/Drawing/Text/DrawText.cs b/tests/ImageSharp.Tests/Drawing/Text/DrawText.cs index 2a03eb415..76f40e0ac 100644 --- a/tests/ImageSharp.Tests/Drawing/Text/DrawText.cs +++ b/tests/ImageSharp.Tests/Drawing/Text/DrawText.cs @@ -4,11 +4,8 @@ using System.Numerics; using SixLabors.Fonts; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Drawing.Brushes; -using SixLabors.ImageSharp.Processing.Drawing.Pens; -using SixLabors.ImageSharp.Processing.Drawing.Processors; -using SixLabors.ImageSharp.Processing.Text; -using SixLabors.ImageSharp.Processing.Text.Processors; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Text; using SixLabors.Primitives; using SixLabors.Shapes; using Xunit; diff --git a/tests/ImageSharp.Tests/Drawing/Text/DrawTextOnImageTests.cs b/tests/ImageSharp.Tests/Drawing/Text/DrawTextOnImageTests.cs index 0885dd183..44bb160ce 100644 --- a/tests/ImageSharp.Tests/Drawing/Text/DrawTextOnImageTests.cs +++ b/tests/ImageSharp.Tests/Drawing/Text/DrawTextOnImageTests.cs @@ -7,8 +7,6 @@ using System.Text; using SixLabors.Fonts; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Drawing.Pens; -using SixLabors.ImageSharp.Processing.Text; using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison; using SixLabors.Primitives; diff --git a/tests/ImageSharp.Tests/Drawing/Text/TextGraphicsOptionsTests.cs b/tests/ImageSharp.Tests/Drawing/Text/TextGraphicsOptionsTests.cs index d710229ff..0885611c6 100644 --- a/tests/ImageSharp.Tests/Drawing/Text/TextGraphicsOptionsTests.cs +++ b/tests/ImageSharp.Tests/Drawing/Text/TextGraphicsOptionsTests.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using SixLabors.ImageSharp.Processing.Text; +using SixLabors.ImageSharp.Processing; using Xunit; diff --git a/tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs b/tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs index cd3b72e27..23b806767 100644 --- a/tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs +++ b/tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs @@ -17,7 +17,7 @@ namespace SixLabors.ImageSharp.Tests using SixLabors.Memory; using SixLabors.ImageSharp.Processing; - using SixLabors.ImageSharp.Processing.Quantization; + using SixLabors.ImageSharp.Processing.Processors.Quantization; public class GeneralFormatTests : FileTestBase { diff --git a/tests/ImageSharp.Tests/Formats/Gif/GifEncoderTests.cs b/tests/ImageSharp.Tests/Formats/Gif/GifEncoderTests.cs index 93cfaff7f..2b9c11fb0 100644 --- a/tests/ImageSharp.Tests/Formats/Gif/GifEncoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Gif/GifEncoderTests.cs @@ -5,7 +5,7 @@ using System.IO; using SixLabors.ImageSharp.Formats.Gif; using SixLabors.ImageSharp.MetaData; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Quantization; +using SixLabors.ImageSharp.Processing.Processors.Quantization; using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison; using Xunit; // ReSharper disable InconsistentNaming diff --git a/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.Images.cs b/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.Images.cs index 539ab7319..3c98d5be7 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.Images.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.Images.cs @@ -38,6 +38,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg TestImages.Jpeg.Issues.NoEoiProgressive517, TestImages.Jpeg.Issues.BadRstProgressive518, TestImages.Jpeg.Issues.MissingFF00ProgressiveBedroom159, + TestImages.Jpeg.Issues.DhtHasWrongLength624, }; /// diff --git a/tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs b/tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs index 3bcecedec..540fc0716 100644 --- a/tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs @@ -9,7 +9,7 @@ using SixLabors.ImageSharp.Formats; using SixLabors.ImageSharp.Formats.Png; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Quantization; +using SixLabors.ImageSharp.Processing.Processors.Quantization; using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison; using Xunit; diff --git a/tests/ImageSharp.Tests/Formats/Png/PngSmokeTests.cs b/tests/ImageSharp.Tests/Formats/Png/PngSmokeTests.cs index e7fd21d96..81a31e42d 100644 --- a/tests/ImageSharp.Tests/Formats/Png/PngSmokeTests.cs +++ b/tests/ImageSharp.Tests/Formats/Png/PngSmokeTests.cs @@ -5,14 +5,12 @@ using System.IO; using Xunit; using SixLabors.ImageSharp.Formats; using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison; using SixLabors.ImageSharp.Formats.Png; namespace SixLabors.ImageSharp.Tests.Formats.Png { - using SixLabors.ImageSharp.Processing; - using SixLabors.ImageSharp.Processing.Transforms; - public class PngSmokeTests { [Theory] diff --git a/tests/ImageSharp.Tests/Image/ImageProcessingContextTests.cs b/tests/ImageSharp.Tests/Image/ImageProcessingContextTests.cs index 4e149da50..041b6c846 100644 --- a/tests/ImageSharp.Tests/Image/ImageProcessingContextTests.cs +++ b/tests/ImageSharp.Tests/Image/ImageProcessingContextTests.cs @@ -1,17 +1,13 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -//using SixLabors.ImageSharp.Processing; - using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; using SixLabors.Primitives; using Xunit; namespace SixLabors.ImageSharp.Tests { - using SixLabors.ImageSharp.Processing; - using SixLabors.ImageSharp.Processing.Transforms; - public class ImageProcessingContextTests { [Fact] diff --git a/tests/ImageSharp.Tests/Image/ImageRotationTests.cs b/tests/ImageSharp.Tests/Image/ImageRotationTests.cs index 8310d67e8..e1c4a419e 100644 --- a/tests/ImageSharp.Tests/Image/ImageRotationTests.cs +++ b/tests/ImageSharp.Tests/Image/ImageRotationTests.cs @@ -2,14 +2,12 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; using SixLabors.Primitives; using Xunit; namespace SixLabors.ImageSharp.Tests { - using SixLabors.ImageSharp.Processing; - using SixLabors.ImageSharp.Processing.Transforms; - public class ImageRotationTests { [Fact] diff --git a/tests/ImageSharp.Tests/Issues/Issue412.cs b/tests/ImageSharp.Tests/Issues/Issue412.cs index a1bf7f36a..6123c822b 100644 --- a/tests/ImageSharp.Tests/Issues/Issue412.cs +++ b/tests/ImageSharp.Tests/Issues/Issue412.cs @@ -2,12 +2,10 @@ using Xunit; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Drawing; +using SixLabors.ImageSharp.Processing; namespace SixLabors.ImageSharp.Tests.Issues { - using SixLabors.ImageSharp.Processing; - public class Issue412 { [Theory] diff --git a/tests/ImageSharp.Tests/PixelFormats/PixelBlenders/PorterDuffCompositorTests.cs b/tests/ImageSharp.Tests/PixelFormats/PixelBlenders/PorterDuffCompositorTests.cs index 36473fa56..120619fb5 100644 --- a/tests/ImageSharp.Tests/PixelFormats/PixelBlenders/PorterDuffCompositorTests.cs +++ b/tests/ImageSharp.Tests/PixelFormats/PixelBlenders/PorterDuffCompositorTests.cs @@ -5,7 +5,6 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelBlenders { using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; - using SixLabors.ImageSharp.Processing.Drawing; using Xunit; diff --git a/tests/ImageSharp.Tests/Processing/Binarization/BinaryDitherTest.cs b/tests/ImageSharp.Tests/Processing/Binarization/BinaryDitherTest.cs index 46198991a..5f6e825f6 100644 --- a/tests/ImageSharp.Tests/Processing/Binarization/BinaryDitherTest.cs +++ b/tests/ImageSharp.Tests/Processing/Binarization/BinaryDitherTest.cs @@ -2,12 +2,9 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; - -using SixLabors.ImageSharp.Processing.Binarization; -using SixLabors.ImageSharp.Processing.Binarization.Processors; -using SixLabors.ImageSharp.Processing.Dithering; -using SixLabors.ImageSharp.Processing.Dithering.ErrorDiffusion; -using SixLabors.ImageSharp.Processing.Dithering.Ordered; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Binarization; +using SixLabors.ImageSharp.Processing.Processors.Dithering; using Xunit; diff --git a/tests/ImageSharp.Tests/Processing/Binarization/BinaryThresholdTest.cs b/tests/ImageSharp.Tests/Processing/Binarization/BinaryThresholdTest.cs index bf15db366..569c4ba21 100644 --- a/tests/ImageSharp.Tests/Processing/Binarization/BinaryThresholdTest.cs +++ b/tests/ImageSharp.Tests/Processing/Binarization/BinaryThresholdTest.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Binarization; -using SixLabors.ImageSharp.Processing.Binarization.Processors; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Binarization; using Xunit; diff --git a/tests/ImageSharp.Tests/Processing/Binarization/OrderedDitherFactoryTests.cs b/tests/ImageSharp.Tests/Processing/Binarization/OrderedDitherFactoryTests.cs index 3e1a7acc0..c98f91046 100644 --- a/tests/ImageSharp.Tests/Processing/Binarization/OrderedDitherFactoryTests.cs +++ b/tests/ImageSharp.Tests/Processing/Binarization/OrderedDitherFactoryTests.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.Primitives; -using SixLabors.ImageSharp.Processing.Dithering.Ordered; +using SixLabors.ImageSharp.Processing.Processors.Dithering; using Xunit; diff --git a/tests/ImageSharp.Tests/Processing/Convolution/BoxBlurTest.cs b/tests/ImageSharp.Tests/Processing/Convolution/BoxBlurTest.cs index 07c69a94c..e425b6315 100644 --- a/tests/ImageSharp.Tests/Processing/Convolution/BoxBlurTest.cs +++ b/tests/ImageSharp.Tests/Processing/Convolution/BoxBlurTest.cs @@ -2,15 +2,12 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Processors; -using SixLabors.Primitives; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Convolution; using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Convolution { - using SixLabors.ImageSharp.Processing.Convolution; - using SixLabors.ImageSharp.Processing.Convolution.Processors; - public class BoxBlurTest : BaseImageOperationsExtensionTest { [Fact] diff --git a/tests/ImageSharp.Tests/Processing/Convolution/DetectEdgesTest.cs b/tests/ImageSharp.Tests/Processing/Convolution/DetectEdgesTest.cs index 45a5b0313..60fa19b49 100644 --- a/tests/ImageSharp.Tests/Processing/Convolution/DetectEdgesTest.cs +++ b/tests/ImageSharp.Tests/Processing/Convolution/DetectEdgesTest.cs @@ -5,15 +5,13 @@ using System.Collections.Generic; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.ImageSharp.Processing.Processors.Convolution; using SixLabors.ImageSharp.Tests.TestUtilities; using SixLabors.Primitives; using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Convolution { - using SixLabors.ImageSharp.Processing.Convolution; - using SixLabors.ImageSharp.Processing.Convolution.Processors; - public class DetectEdgesTest : BaseImageOperationsExtensionTest { diff --git a/tests/ImageSharp.Tests/Processing/Convolution/GaussianBlurTest.cs b/tests/ImageSharp.Tests/Processing/Convolution/GaussianBlurTest.cs index 5399a7ec8..c87a834eb 100644 --- a/tests/ImageSharp.Tests/Processing/Convolution/GaussianBlurTest.cs +++ b/tests/ImageSharp.Tests/Processing/Convolution/GaussianBlurTest.cs @@ -2,15 +2,12 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Processors; -using SixLabors.Primitives; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Convolution; using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Convolution { - using SixLabors.ImageSharp.Processing.Convolution; - using SixLabors.ImageSharp.Processing.Convolution.Processors; - public class GaussianBlurTest : BaseImageOperationsExtensionTest { [Fact] diff --git a/tests/ImageSharp.Tests/Processing/Convolution/GaussianSharpenTest.cs b/tests/ImageSharp.Tests/Processing/Convolution/GaussianSharpenTest.cs index 518c2960f..675498745 100644 --- a/tests/ImageSharp.Tests/Processing/Convolution/GaussianSharpenTest.cs +++ b/tests/ImageSharp.Tests/Processing/Convolution/GaussianSharpenTest.cs @@ -2,15 +2,12 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Processors; -using SixLabors.Primitives; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Convolution; using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Convolution { - using SixLabors.ImageSharp.Processing.Convolution; - using SixLabors.ImageSharp.Processing.Convolution.Processors; - public class GaussianSharpenTest : BaseImageOperationsExtensionTest { [Fact] diff --git a/tests/ImageSharp.Tests/Processing/Convolution/Processors/LaplacianKernelFactoryTests.cs b/tests/ImageSharp.Tests/Processing/Convolution/Processors/LaplacianKernelFactoryTests.cs index 439632210..8b3524fe6 100644 --- a/tests/ImageSharp.Tests/Processing/Convolution/Processors/LaplacianKernelFactoryTests.cs +++ b/tests/ImageSharp.Tests/Processing/Convolution/Processors/LaplacianKernelFactoryTests.cs @@ -3,10 +3,10 @@ using System; using SixLabors.ImageSharp.Primitives; -using SixLabors.ImageSharp.Processing.Convolution.Processors; +using SixLabors.ImageSharp.Processing.Processors.Convolution; using Xunit; -namespace SixLabors.ImageSharp.Tests.Processing.Convolution.Processors +namespace SixLabors.ImageSharp.Tests.Processing.Processors.Convolution { public class LaplacianKernelFactoryTests { diff --git a/tests/ImageSharp.Tests/Processing/Dithering/DitherTest.cs b/tests/ImageSharp.Tests/Processing/Dithering/DitherTest.cs index e53de85fe..f393d5923 100644 --- a/tests/ImageSharp.Tests/Processing/Dithering/DitherTest.cs +++ b/tests/ImageSharp.Tests/Processing/Dithering/DitherTest.cs @@ -2,10 +2,9 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; using SixLabors.ImageSharp.Processing.Dithering; -using SixLabors.ImageSharp.Processing.Dithering.ErrorDiffusion; -using SixLabors.ImageSharp.Processing.Dithering.Ordered; -using SixLabors.ImageSharp.Processing.Dithering.Processors; +using SixLabors.ImageSharp.Processing.Processors.Dithering; using Xunit; diff --git a/tests/ImageSharp.Tests/Processing/Effects/BackgroundColorTest.cs b/tests/ImageSharp.Tests/Processing/Effects/BackgroundColorTest.cs index 6aa8fbba6..7775de2d2 100644 --- a/tests/ImageSharp.Tests/Processing/Effects/BackgroundColorTest.cs +++ b/tests/ImageSharp.Tests/Processing/Effects/BackgroundColorTest.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Overlays; -using SixLabors.ImageSharp.Processing.Overlays.Processors; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Overlays; using Xunit; diff --git a/tests/ImageSharp.Tests/Processing/Effects/OilPaintTest.cs b/tests/ImageSharp.Tests/Processing/Effects/OilPaintTest.cs index 2f4ba0516..9cd24fc6d 100644 --- a/tests/ImageSharp.Tests/Processing/Effects/OilPaintTest.cs +++ b/tests/ImageSharp.Tests/Processing/Effects/OilPaintTest.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Effects; -using SixLabors.ImageSharp.Processing.Effects.Processors; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Effects; using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Effects diff --git a/tests/ImageSharp.Tests/Processing/Effects/PixelateTest.cs b/tests/ImageSharp.Tests/Processing/Effects/PixelateTest.cs index 245e104f9..a93eaf0bc 100644 --- a/tests/ImageSharp.Tests/Processing/Effects/PixelateTest.cs +++ b/tests/ImageSharp.Tests/Processing/Effects/PixelateTest.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Effects; -using SixLabors.ImageSharp.Processing.Effects.Processors; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Effects; using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Effects diff --git a/tests/ImageSharp.Tests/Processing/Filters/BlackWhiteTest.cs b/tests/ImageSharp.Tests/Processing/Filters/BlackWhiteTest.cs index 7e06e67d7..d651f2f04 100644 --- a/tests/ImageSharp.Tests/Processing/Filters/BlackWhiteTest.cs +++ b/tests/ImageSharp.Tests/Processing/Filters/BlackWhiteTest.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Filters; -using SixLabors.ImageSharp.Processing.Filters.Processors; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Filters; using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Filters diff --git a/tests/ImageSharp.Tests/Processing/Filters/BrightnessTest.cs b/tests/ImageSharp.Tests/Processing/Filters/BrightnessTest.cs index e47430efa..e210450a8 100644 --- a/tests/ImageSharp.Tests/Processing/Filters/BrightnessTest.cs +++ b/tests/ImageSharp.Tests/Processing/Filters/BrightnessTest.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Filters; -using SixLabors.ImageSharp.Processing.Filters.Processors; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Filters; using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Effects diff --git a/tests/ImageSharp.Tests/Processing/Filters/ColorBlindnessTest.cs b/tests/ImageSharp.Tests/Processing/Filters/ColorBlindnessTest.cs index ee99938bb..aeafe5fe1 100644 --- a/tests/ImageSharp.Tests/Processing/Filters/ColorBlindnessTest.cs +++ b/tests/ImageSharp.Tests/Processing/Filters/ColorBlindnessTest.cs @@ -4,8 +4,8 @@ using System.Collections.Generic; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Filters; -using SixLabors.ImageSharp.Processing.Filters.Processors; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Filters; using SixLabors.ImageSharp.Processing.Processors; using SixLabors.ImageSharp.Tests.TestUtilities; diff --git a/tests/ImageSharp.Tests/Processing/Filters/ContrastTest.cs b/tests/ImageSharp.Tests/Processing/Filters/ContrastTest.cs index 2f9a8331d..21a552e6a 100644 --- a/tests/ImageSharp.Tests/Processing/Filters/ContrastTest.cs +++ b/tests/ImageSharp.Tests/Processing/Filters/ContrastTest.cs @@ -7,8 +7,8 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Effects { - using SixLabors.ImageSharp.Processing.Filters; - using SixLabors.ImageSharp.Processing.Filters.Processors; + using SixLabors.ImageSharp.Processing; + using SixLabors.ImageSharp.Processing.Processors.Filters; public class ContrastTest : BaseImageOperationsExtensionTest { diff --git a/tests/ImageSharp.Tests/Processing/Filters/FilterTest.cs b/tests/ImageSharp.Tests/Processing/Filters/FilterTest.cs index cac1d7057..414a0d74e 100644 --- a/tests/ImageSharp.Tests/Processing/Filters/FilterTest.cs +++ b/tests/ImageSharp.Tests/Processing/Filters/FilterTest.cs @@ -8,8 +8,8 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Filters { - using SixLabors.ImageSharp.Processing.Filters; - using SixLabors.ImageSharp.Processing.Filters.Processors; + using SixLabors.ImageSharp.Processing; + using SixLabors.ImageSharp.Processing.Processors.Filters; public class FilterTest : BaseImageOperationsExtensionTest { diff --git a/tests/ImageSharp.Tests/Processing/Filters/GrayscaleTest.cs b/tests/ImageSharp.Tests/Processing/Filters/GrayscaleTest.cs index 667354b28..d63d97820 100644 --- a/tests/ImageSharp.Tests/Processing/Filters/GrayscaleTest.cs +++ b/tests/ImageSharp.Tests/Processing/Filters/GrayscaleTest.cs @@ -4,8 +4,8 @@ using System.Collections.Generic; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Filters; -using SixLabors.ImageSharp.Processing.Filters.Processors; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Filters; using SixLabors.ImageSharp.Processing.Processors; using SixLabors.ImageSharp.Tests.TestUtilities; diff --git a/tests/ImageSharp.Tests/Processing/Filters/HueTest.cs b/tests/ImageSharp.Tests/Processing/Filters/HueTest.cs index 61220d59f..f56578dd6 100644 --- a/tests/ImageSharp.Tests/Processing/Filters/HueTest.cs +++ b/tests/ImageSharp.Tests/Processing/Filters/HueTest.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Filters; -using SixLabors.ImageSharp.Processing.Filters.Processors; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Filters; using Xunit; diff --git a/tests/ImageSharp.Tests/Processing/Filters/InvertTest.cs b/tests/ImageSharp.Tests/Processing/Filters/InvertTest.cs index 61fd206db..c93afc942 100644 --- a/tests/ImageSharp.Tests/Processing/Filters/InvertTest.cs +++ b/tests/ImageSharp.Tests/Processing/Filters/InvertTest.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Filters; -using SixLabors.ImageSharp.Processing.Filters.Processors; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Filters; using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Effects diff --git a/tests/ImageSharp.Tests/Processing/Filters/KodachromeTest.cs b/tests/ImageSharp.Tests/Processing/Filters/KodachromeTest.cs index a0a551d09..a98252140 100644 --- a/tests/ImageSharp.Tests/Processing/Filters/KodachromeTest.cs +++ b/tests/ImageSharp.Tests/Processing/Filters/KodachromeTest.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Filters; -using SixLabors.ImageSharp.Processing.Filters.Processors; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Filters; using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Filters diff --git a/tests/ImageSharp.Tests/Processing/Filters/LomographTest.cs b/tests/ImageSharp.Tests/Processing/Filters/LomographTest.cs index 5bd4394ab..c104f8c25 100644 --- a/tests/ImageSharp.Tests/Processing/Filters/LomographTest.cs +++ b/tests/ImageSharp.Tests/Processing/Filters/LomographTest.cs @@ -9,8 +9,8 @@ using Xunit; namespace SixLabors.ImageSharp.Tests { - using SixLabors.ImageSharp.Processing.Filters; - using SixLabors.ImageSharp.Processing.Filters.Processors; + using SixLabors.ImageSharp.Processing; + using SixLabors.ImageSharp.Processing.Processors.Filters; public class LomographTest : BaseImageOperationsExtensionTest { diff --git a/tests/ImageSharp.Tests/Processing/Filters/OpacityTest.cs b/tests/ImageSharp.Tests/Processing/Filters/OpacityTest.cs index 96811544c..adbb8cf29 100644 --- a/tests/ImageSharp.Tests/Processing/Filters/OpacityTest.cs +++ b/tests/ImageSharp.Tests/Processing/Filters/OpacityTest.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Filters; -using SixLabors.ImageSharp.Processing.Filters.Processors; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Filters; using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Effects diff --git a/tests/ImageSharp.Tests/Processing/Filters/PolaroidTest.cs b/tests/ImageSharp.Tests/Processing/Filters/PolaroidTest.cs index 4f7c410f0..f28827b71 100644 --- a/tests/ImageSharp.Tests/Processing/Filters/PolaroidTest.cs +++ b/tests/ImageSharp.Tests/Processing/Filters/PolaroidTest.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Filters; -using SixLabors.ImageSharp.Processing.Filters.Processors; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Filters; using Xunit; diff --git a/tests/ImageSharp.Tests/Processing/Filters/SaturateTest.cs b/tests/ImageSharp.Tests/Processing/Filters/SaturateTest.cs index 830580fc2..4b8e80881 100644 --- a/tests/ImageSharp.Tests/Processing/Filters/SaturateTest.cs +++ b/tests/ImageSharp.Tests/Processing/Filters/SaturateTest.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Filters; -using SixLabors.ImageSharp.Processing.Filters.Processors; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Filters; using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Filters diff --git a/tests/ImageSharp.Tests/Processing/Filters/SepiaTest.cs b/tests/ImageSharp.Tests/Processing/Filters/SepiaTest.cs index 5e01e26f4..9351c8443 100644 --- a/tests/ImageSharp.Tests/Processing/Filters/SepiaTest.cs +++ b/tests/ImageSharp.Tests/Processing/Filters/SepiaTest.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Filters; -using SixLabors.ImageSharp.Processing.Filters.Processors; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Filters; using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Filters diff --git a/tests/ImageSharp.Tests/Processing/Overlays/GlowTest.cs b/tests/ImageSharp.Tests/Processing/Overlays/GlowTest.cs index 4165ea24e..899082e36 100644 --- a/tests/ImageSharp.Tests/Processing/Overlays/GlowTest.cs +++ b/tests/ImageSharp.Tests/Processing/Overlays/GlowTest.cs @@ -5,8 +5,8 @@ using System; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Primitives; -using SixLabors.ImageSharp.Processing.Overlays; -using SixLabors.ImageSharp.Processing.Overlays.Processors; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Overlays; using SixLabors.Primitives; using Xunit; diff --git a/tests/ImageSharp.Tests/Processing/Overlays/VignetteTest.cs b/tests/ImageSharp.Tests/Processing/Overlays/VignetteTest.cs index bd42cf14e..f47bffe26 100644 --- a/tests/ImageSharp.Tests/Processing/Overlays/VignetteTest.cs +++ b/tests/ImageSharp.Tests/Processing/Overlays/VignetteTest.cs @@ -3,8 +3,8 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Primitives; -using SixLabors.ImageSharp.Processing.Overlays; -using SixLabors.ImageSharp.Processing.Overlays.Processors; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Overlays; using SixLabors.Primitives; using Xunit; diff --git a/tests/ImageSharp.Tests/Processing/Processors/Binarization/BinaryDitherTests.cs b/tests/ImageSharp.Tests/Processing/Processors/Binarization/BinaryDitherTests.cs index eb5785919..44fdfc703 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Binarization/BinaryDitherTests.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Binarization/BinaryDitherTests.cs @@ -3,10 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Binarization; -using SixLabors.ImageSharp.Processing.Dithering; -using SixLabors.ImageSharp.Processing.Dithering.ErrorDiffusion; -using SixLabors.ImageSharp.Processing.Dithering.Ordered; +using SixLabors.ImageSharp.Processing.Processors.Dithering; using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison; using SixLabors.Primitives; diff --git a/tests/ImageSharp.Tests/Processing/Processors/Binarization/BinaryThresholdTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Binarization/BinaryThresholdTest.cs index b1092782c..988c9125b 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Binarization/BinaryThresholdTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Binarization/BinaryThresholdTest.cs @@ -10,7 +10,6 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Binarization { using SixLabors.ImageSharp.Processing; - using SixLabors.ImageSharp.Processing.Binarization; public class BinaryThresholdTest : FileTestBase { diff --git a/tests/ImageSharp.Tests/Processing/Processors/Convolution/BoxBlurTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Convolution/BoxBlurTest.cs index b49fbf435..0c40debad 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Convolution/BoxBlurTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Convolution/BoxBlurTest.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison; using SixLabors.Primitives; @@ -9,9 +10,6 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Convolution { - using SixLabors.ImageSharp.Processing; - using SixLabors.ImageSharp.Processing.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 ae172a0bf..a32239d96 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Convolution/DetectEdgesTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Convolution/DetectEdgesTest.cs @@ -3,7 +3,6 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Convolution; using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison; using SixLabors.Primitives; using Xunit; diff --git a/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianBlurTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianBlurTest.cs index 3b6a52bb1..6bd3b34bb 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianBlurTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianBlurTest.cs @@ -3,7 +3,6 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Convolution; using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison; using SixLabors.Primitives; diff --git a/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianSharpenTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianSharpenTest.cs index 3d97cf0d0..8eb1f85eb 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianSharpenTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianSharpenTest.cs @@ -3,7 +3,6 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Convolution; using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison; using SixLabors.Primitives; using Xunit; diff --git a/tests/ImageSharp.Tests/Processing/Processors/Dithering/DitherTests.cs b/tests/ImageSharp.Tests/Processing/Processors/Dithering/DitherTests.cs index ba31e35a2..9774cb50c 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Dithering/DitherTests.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Dithering/DitherTests.cs @@ -5,8 +5,7 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison; using SixLabors.ImageSharp.Processing; using SixLabors.ImageSharp.Processing.Dithering; -using SixLabors.ImageSharp.Processing.Dithering.ErrorDiffusion; -using SixLabors.ImageSharp.Processing.Dithering.Ordered; +using SixLabors.ImageSharp.Processing.Processors.Dithering; using SixLabors.Primitives; using Xunit; diff --git a/tests/ImageSharp.Tests/Processing/Processors/Effects/BackgroundColorTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Effects/BackgroundColorTest.cs index 1e234e81e..792c7b080 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Effects/BackgroundColorTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Effects/BackgroundColorTest.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison; using SixLabors.Primitives; @@ -9,9 +10,6 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects { - using SixLabors.ImageSharp.Processing; - using SixLabors.ImageSharp.Processing.Overlays; - public class BackgroundColorTest : FileTestBase { [Theory] diff --git a/tests/ImageSharp.Tests/Processing/Processors/Effects/OilPaintTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Effects/OilPaintTest.cs index 715e997bf..d4429aaf3 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Effects/OilPaintTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Effects/OilPaintTest.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison; using SixLabors.Primitives; @@ -9,9 +10,6 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects { - using SixLabors.ImageSharp.Processing; - using SixLabors.ImageSharp.Processing.Effects; - public class OilPaintTest : FileTestBase { public static readonly TheoryData OilPaintValues = new TheoryData diff --git a/tests/ImageSharp.Tests/Processing/Processors/Effects/PixelateTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Effects/PixelateTest.cs index 84831e415..cb9a0ba0c 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Effects/PixelateTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Effects/PixelateTest.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison; using SixLabors.Primitives; @@ -9,9 +10,6 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects { - using SixLabors.ImageSharp.Processing; - using SixLabors.ImageSharp.Processing.Effects; - public class PixelateTest : FileTestBase { public static readonly TheoryData PixelateValues diff --git a/tests/ImageSharp.Tests/Processing/Processors/Filters/BlackWhiteTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Filters/BlackWhiteTest.cs index f360faff4..64aeae053 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Filters/BlackWhiteTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Filters/BlackWhiteTest.cs @@ -7,7 +7,7 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters { - using SixLabors.ImageSharp.Processing.Filters; + using SixLabors.ImageSharp.Processing; using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison; [GroupOutput("Filters")] diff --git a/tests/ImageSharp.Tests/Processing/Processors/Filters/BrightnessTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Filters/BrightnessTest.cs index 14f5fa080..ed790cbac 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Filters/BrightnessTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Filters/BrightnessTest.cs @@ -7,7 +7,7 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects { - using SixLabors.ImageSharp.Processing.Filters; + using SixLabors.ImageSharp.Processing; [GroupOutput("Filters")] public class BrightnessTest diff --git a/tests/ImageSharp.Tests/Processing/Processors/Filters/ColorBlindnessTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Filters/ColorBlindnessTest.cs index fd7724531..3d48e16ec 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Filters/ColorBlindnessTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Filters/ColorBlindnessTest.cs @@ -8,7 +8,7 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters { - using SixLabors.ImageSharp.Processing.Filters; + using SixLabors.ImageSharp.Processing; [GroupOutput("Filters")] public class ColorBlindnessTest diff --git a/tests/ImageSharp.Tests/Processing/Processors/Filters/ContrastTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Filters/ContrastTest.cs index c6afc5e11..e5e4fa4a9 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Filters/ContrastTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Filters/ContrastTest.cs @@ -7,7 +7,7 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects { - using SixLabors.ImageSharp.Processing.Filters; + using SixLabors.ImageSharp.Processing; [GroupOutput("Filters")] public class ContrastTest diff --git a/tests/ImageSharp.Tests/Processing/Processors/Filters/FilterTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Filters/FilterTest.cs index d275c1b1a..479a3c33a 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Filters/FilterTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Filters/FilterTest.cs @@ -11,7 +11,7 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters { - using SixLabors.ImageSharp.Processing.Filters; + using SixLabors.ImageSharp.Processing; [GroupOutput("Filters")] public class FilterTest diff --git a/tests/ImageSharp.Tests/Processing/Processors/Filters/GrayscaleTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Filters/GrayscaleTest.cs index 192034fbb..f08ec147e 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Filters/GrayscaleTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Filters/GrayscaleTest.cs @@ -9,7 +9,7 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters { - using SixLabors.ImageSharp.Processing.Filters; + using SixLabors.ImageSharp.Processing; [GroupOutput("Filters")] public class GrayscaleTest diff --git a/tests/ImageSharp.Tests/Processing/Processors/Filters/HueTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Filters/HueTest.cs index 6e3fd5fef..4ce700bad 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Filters/HueTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Filters/HueTest.cs @@ -7,7 +7,7 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters { - using SixLabors.ImageSharp.Processing.Filters; + using SixLabors.ImageSharp.Processing; [GroupOutput("Filters")] public class HueTest diff --git a/tests/ImageSharp.Tests/Processing/Processors/Filters/InvertTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Filters/InvertTest.cs index de105437b..1b4c70646 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Filters/InvertTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Filters/InvertTest.cs @@ -7,7 +7,7 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects { - using SixLabors.ImageSharp.Processing.Filters; + using SixLabors.ImageSharp.Processing; [GroupOutput("Filters")] public class InvertTest diff --git a/tests/ImageSharp.Tests/Processing/Processors/Filters/KodachromeTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Filters/KodachromeTest.cs index 2265e0b0b..b7b635c2d 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Filters/KodachromeTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Filters/KodachromeTest.cs @@ -7,7 +7,7 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters { - using SixLabors.ImageSharp.Processing.Filters; + using SixLabors.ImageSharp.Processing; [GroupOutput("Filters")] public class KodachromeTest diff --git a/tests/ImageSharp.Tests/Processing/Processors/Filters/LomographTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Filters/LomographTest.cs index 92c5b788c..013ec3874 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Filters/LomographTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Filters/LomographTest.cs @@ -7,7 +7,7 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters { - using SixLabors.ImageSharp.Processing.Filters; + using SixLabors.ImageSharp.Processing; [GroupOutput("Filters")] public class LomographTest diff --git a/tests/ImageSharp.Tests/Processing/Processors/Filters/OpacityTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Filters/OpacityTest.cs index c76bf3b1d..35e405f4c 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Filters/OpacityTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Filters/OpacityTest.cs @@ -7,7 +7,7 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects { - using SixLabors.ImageSharp.Processing.Filters; + using SixLabors.ImageSharp.Processing; [GroupOutput("Filters")] public class OpacityTest diff --git a/tests/ImageSharp.Tests/Processing/Processors/Filters/PolaroidTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Filters/PolaroidTest.cs index 19fcc6788..3b39542a5 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Filters/PolaroidTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Filters/PolaroidTest.cs @@ -7,7 +7,7 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters { - using SixLabors.ImageSharp.Processing.Filters; + using SixLabors.ImageSharp.Processing; [GroupOutput("Filters")] public class PolaroidTest diff --git a/tests/ImageSharp.Tests/Processing/Processors/Filters/SaturateTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Filters/SaturateTest.cs index 18d77660e..31fab8b65 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Filters/SaturateTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Filters/SaturateTest.cs @@ -7,7 +7,7 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters { - using SixLabors.ImageSharp.Processing.Filters; + using SixLabors.ImageSharp.Processing; [GroupOutput("Filters")] public class SaturateTest diff --git a/tests/ImageSharp.Tests/Processing/Processors/Filters/SepiaTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Filters/SepiaTest.cs index 50bf0e3a1..b7d381f5f 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Filters/SepiaTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Filters/SepiaTest.cs @@ -7,7 +7,7 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Filters { - using SixLabors.ImageSharp.Processing.Filters; + using SixLabors.ImageSharp.Processing; [GroupOutput("Filters")] public class SepiaTest diff --git a/tests/ImageSharp.Tests/Processing/Processors/Overlays/GlowTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Overlays/GlowTest.cs index 5c610fb31..479ee346a 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Overlays/GlowTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Overlays/GlowTest.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison; using SixLabors.Primitives; @@ -9,9 +10,6 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Overlays { - using SixLabors.ImageSharp.Processing; - using SixLabors.ImageSharp.Processing.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 1c69b531c..3a378a095 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Overlays/VignetteTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Overlays/VignetteTest.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison; using SixLabors.Primitives; @@ -9,9 +10,6 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Overlays { - using SixLabors.ImageSharp.Processing; - using SixLabors.ImageSharp.Processing.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 9f353f813..85c803ae6 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/AutoOrientTests.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/AutoOrientTests.cs @@ -5,13 +5,11 @@ using System; using SixLabors.ImageSharp.MetaData.Profiles.Exif; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder; using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms { - using SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder; - using SixLabors.ImageSharp.Processing.Transforms; - public class AutoOrientTests : FileTestBase { public static readonly string[] FlipFiles = { TestImages.Bmp.F }; diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/CropTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/CropTest.cs index 0936bf477..c154c8ff3 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/CropTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/CropTest.cs @@ -3,8 +3,6 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Transforms; - using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/EntropyCropTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/EntropyCropTest.cs index 86b37365d..728527021 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/EntropyCropTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/EntropyCropTest.cs @@ -3,8 +3,6 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Transforms; - using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/FlipTests.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/FlipTests.cs index 0ac8a9459..d7e7a724c 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/FlipTests.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/FlipTests.cs @@ -9,7 +9,7 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms { - using SixLabors.ImageSharp.Processing.Transforms; + using SixLabors.ImageSharp.Processing; public class FlipTests { diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/PadTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/PadTest.cs index 3294ecc73..6cce62d14 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/PadTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/PadTest.cs @@ -2,13 +2,11 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms { - using SixLabors.ImageSharp.Processing; - using SixLabors.ImageSharp.Processing.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 ab19c21eb..d5f015404 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeProfilingBenchmarks.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeProfilingBenchmarks.cs @@ -7,9 +7,7 @@ using System.Text; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Processors; -using SixLabors.ImageSharp.Processing.Transforms; -using SixLabors.ImageSharp.Processing.Transforms.Processors; +using SixLabors.ImageSharp.Processing.Processors.Transforms; using SixLabors.Primitives; using Xunit.Abstractions; diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs index 6a6dc45f7..c7efbb1e0 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs @@ -5,8 +5,7 @@ using System; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Transforms; -using SixLabors.ImageSharp.Processing.Transforms.Resamplers; +using SixLabors.ImageSharp.Processing.Processors.Transforms; using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison; using SixLabors.Primitives; diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateFlipTests.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateFlipTests.cs index b2865d9da..d6376b179 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateFlipTests.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateFlipTests.cs @@ -7,7 +7,7 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms { - using SixLabors.ImageSharp.Processing.Transforms; + using SixLabors.ImageSharp.Processing; public class RotateFlipTests : FileTestBase { diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateTests.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateTests.cs index 2163f5fc9..c0db205f9 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateTests.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateTests.cs @@ -3,8 +3,6 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Transforms; - using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms @@ -25,7 +23,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms RotateMode.Rotate180, RotateMode.Rotate270 }; - + [Theory] [WithTestPatternImages(nameof(RotateAngles), 100, 50, DefaultPixelType)] [WithTestPatternImages(nameof(RotateAngles), 50, 100, DefaultPixelType)] @@ -38,7 +36,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms image.DebugSave(provider, value); } } - + [Theory] [WithTestPatternImages(nameof(RotateEnumValues), 100, 50, DefaultPixelType)] [WithTestPatternImages(nameof(RotateEnumValues), 50, 100, DefaultPixelType)] diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/SkewTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/SkewTest.cs index 30c9e682d..ae2b12e87 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/SkewTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/SkewTest.cs @@ -1,19 +1,17 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using System; +using System.Collections.Generic; +using System.Reflection; + +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Transforms; using SixLabors.ImageSharp.PixelFormats; using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms { - using System; - using System.Collections.Generic; - using System.Reflection; - - using SixLabors.ImageSharp.Processing; - using SixLabors.ImageSharp.Processing.Transforms; - using SixLabors.ImageSharp.Processing.Transforms.Resamplers; - public class SkewTest : FileTestBase { public static readonly TheoryData SkewValues diff --git a/tests/ImageSharp.Tests/Processing/Transforms/AffineTransformTests.cs b/tests/ImageSharp.Tests/Processing/Transforms/AffineTransformTests.cs index fae876aff..8ec8409ad 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/AffineTransformTests.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/AffineTransformTests.cs @@ -4,8 +4,7 @@ using System.Reflection; using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Transforms; -using SixLabors.ImageSharp.Processing.Transforms.Resamplers; +using SixLabors.ImageSharp.Processing.Processors.Transforms; using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison; using SixLabors.Primitives; @@ -14,7 +13,6 @@ using Xunit.Abstractions; namespace SixLabors.ImageSharp.Tests.Processing.Transforms { - public class AffineTransformTests { private readonly ITestOutputHelper Output; diff --git a/tests/ImageSharp.Tests/Processing/Transforms/AutoOrientTests.cs b/tests/ImageSharp.Tests/Processing/Transforms/AutoOrientTests.cs index d01e84220..bba4661db 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/AutoOrientTests.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/AutoOrientTests.cs @@ -7,8 +7,8 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Transforms { - using SixLabors.ImageSharp.Processing.Transforms; - using SixLabors.ImageSharp.Processing.Transforms.Processors; + using SixLabors.ImageSharp.Processing; + using SixLabors.ImageSharp.Processing.Processors.Transforms; public class AutoOrientTests : BaseImageOperationsExtensionTest { diff --git a/tests/ImageSharp.Tests/Processing/Transforms/CropTest.cs b/tests/ImageSharp.Tests/Processing/Transforms/CropTest.cs index 78b6852e4..154167f15 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/CropTest.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/CropTest.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Transforms; -using SixLabors.ImageSharp.Processing.Transforms.Processors; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Transforms; using SixLabors.Primitives; using Xunit; diff --git a/tests/ImageSharp.Tests/Processing/Transforms/EntropyCropTest.cs b/tests/ImageSharp.Tests/Processing/Transforms/EntropyCropTest.cs index 9c2176b25..03a8628a5 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/EntropyCropTest.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/EntropyCropTest.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Transforms; -using SixLabors.ImageSharp.Processing.Transforms.Processors; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Transforms; using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Transforms diff --git a/tests/ImageSharp.Tests/Processing/Transforms/FlipTests.cs b/tests/ImageSharp.Tests/Processing/Transforms/FlipTests.cs index 41aeb1ad5..39adcaa3f 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/FlipTests.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/FlipTests.cs @@ -9,8 +9,8 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Transforms { - using SixLabors.ImageSharp.Processing.Transforms; - using SixLabors.ImageSharp.Processing.Transforms.Processors; + using SixLabors.ImageSharp.Processing; + using SixLabors.ImageSharp.Processing.Processors.Transforms; public class FlipTests : BaseImageOperationsExtensionTest { diff --git a/tests/ImageSharp.Tests/Processing/Transforms/PadTest.cs b/tests/ImageSharp.Tests/Processing/Transforms/PadTest.cs index dd4c31458..82d768255 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/PadTest.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/PadTest.cs @@ -2,13 +2,13 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Transforms.Resamplers; +using SixLabors.ImageSharp.Processing.Processors.Transforms; using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Transforms { - using SixLabors.ImageSharp.Processing.Transforms; - using SixLabors.ImageSharp.Processing.Transforms.Processors; + using SixLabors.ImageSharp.Processing; + using SixLabors.ImageSharp.Processing.Processors.Transforms; public class PadTest : BaseImageOperationsExtensionTest { diff --git a/tests/ImageSharp.Tests/Processing/Transforms/ProjectiveTransformTests.cs b/tests/ImageSharp.Tests/Processing/Transforms/ProjectiveTransformTests.cs index ece3f1742..f0a924d27 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/ProjectiveTransformTests.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/ProjectiveTransformTests.cs @@ -6,16 +6,14 @@ using System.Numerics; using System.Reflection; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Transforms; -using SixLabors.ImageSharp.Processing.Transforms.Resamplers; +using SixLabors.ImageSharp.Processing.Processors.Transforms; using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison; using Xunit; +using Xunit.Abstractions; // ReSharper disable InconsistentNaming namespace SixLabors.ImageSharp.Tests.Processing.Transforms { - using Xunit.Abstractions; - public class ProjectiveTransformTests { private static readonly ImageComparer ValidatorComparer = ImageComparer.TolerantPercentage(0.03f, 3); diff --git a/tests/ImageSharp.Tests/Processing/Transforms/ResizeTests.cs b/tests/ImageSharp.Tests/Processing/Transforms/ResizeTests.cs index ee72f361b..948c79d8d 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/ResizeTests.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/ResizeTests.cs @@ -2,9 +2,8 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Transforms; -using SixLabors.ImageSharp.Processing.Transforms.Processors; -using SixLabors.ImageSharp.Processing.Transforms.Resamplers; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Transforms; using SixLabors.Primitives; using Xunit; diff --git a/tests/ImageSharp.Tests/Processing/Transforms/RotateFlipTests.cs b/tests/ImageSharp.Tests/Processing/Transforms/RotateFlipTests.cs index 9a396e871..dccf7afa6 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/RotateFlipTests.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/RotateFlipTests.cs @@ -2,8 +2,8 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Transforms; -using SixLabors.ImageSharp.Processing.Transforms.Processors; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Transforms; using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Transforms diff --git a/tests/ImageSharp.Tests/Processing/Transforms/RotateTests.cs b/tests/ImageSharp.Tests/Processing/Transforms/RotateTests.cs index 2bf7cded8..ae312d723 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/RotateTests.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/RotateTests.cs @@ -3,9 +3,7 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Processors; -using SixLabors.ImageSharp.Processing.Transforms; -using SixLabors.ImageSharp.Processing.Transforms.Processors; +using SixLabors.ImageSharp.Processing.Processors.Transforms; using Xunit; diff --git a/tests/ImageSharp.Tests/Processing/Transforms/SkewTest.cs b/tests/ImageSharp.Tests/Processing/Transforms/SkewTest.cs index 9df8e267c..73754b971 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/SkewTest.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/SkewTest.cs @@ -3,8 +3,8 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing.Processors; -using SixLabors.ImageSharp.Processing.Transforms; -using SixLabors.ImageSharp.Processing.Transforms.Processors; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Transforms; using Xunit; diff --git a/tests/ImageSharp.Tests/Processing/Transforms/TransformsHelpersTest.cs b/tests/ImageSharp.Tests/Processing/Transforms/TransformsHelpersTest.cs index 5de92a40b..146ed6230 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/TransformsHelpersTest.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/TransformsHelpersTest.cs @@ -3,8 +3,7 @@ using SixLabors.ImageSharp.MetaData.Profiles.Exif; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Transforms; - +using SixLabors.ImageSharp.Processing.Processors.Transforms; using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Transforms diff --git a/tests/ImageSharp.Tests/Quantization/QuantizedImageTests.cs b/tests/ImageSharp.Tests/Quantization/QuantizedImageTests.cs index 91b331639..c2b1c26c5 100644 --- a/tests/ImageSharp.Tests/Quantization/QuantizedImageTests.cs +++ b/tests/ImageSharp.Tests/Quantization/QuantizedImageTests.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Quantization; +using SixLabors.ImageSharp.Processing.Processors.Quantization; using Xunit; diff --git a/tests/ImageSharp.Tests/TestDataIcc/IccTestDataProfiles.cs b/tests/ImageSharp.Tests/TestDataIcc/IccTestDataProfiles.cs index cf8cffb32..35ffa2bbb 100644 --- a/tests/ImageSharp.Tests/TestDataIcc/IccTestDataProfiles.cs +++ b/tests/ImageSharp.Tests/TestDataIcc/IccTestDataProfiles.cs @@ -99,12 +99,12 @@ namespace SixLabors.ImageSharp.Tests 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - // Nr of tag table entries (0) + // Nr of tag table entries (byte)(nrOfEntries >> 24), (byte)(nrOfEntries >> 16), (byte)(nrOfEntries >> 8), (byte)nrOfEntries }); } - public static byte[] Profile_Random_Array = ArrayHelper.Concat(CreateHeaderRandomArray(168, 2, Profile_Random_Id_Array), + public static readonly byte[] Profile_Random_Array = ArrayHelper.Concat(CreateHeaderRandomArray(168, 2, Profile_Random_Id_Array), new byte[] { 0x00, 0x00, 0x00, 0x00, // tag signature (Unknown) @@ -119,7 +119,7 @@ namespace SixLabors.ImageSharp.Tests IccTestDataTagDataEntry.Unknown_Arr ); - public static IccProfile Profile_Random_Val = new IccProfile(CreateHeaderRandomValue(168, + public static readonly IccProfile Profile_Random_Val = new IccProfile(CreateHeaderRandomValue(168, #if !NETSTANDARD1_1 Profile_Random_Id_Value, #else @@ -132,41 +132,110 @@ namespace SixLabors.ImageSharp.Tests IccTestDataTagDataEntry.Unknown_Val }); - public static byte[] Header_Corrupt1_Array = + public static readonly byte[] Header_CorruptDataColorSpace_Array = { - 0x81, 0xB1, 0x81, 0xE4, 0x82, 0x16, 0x82, 0x49, 0x82, 0x7B, 0x82, 0xAD, 0x82, 0xDF, 0x83, 0x11, - 0x83, 0x43, 0x83, 0x75, 0x83, 0xA7, 0x83, 0xD8, 0x84, 0x0A, 0x84, 0x3B, 0x84, 0x6C, 0x84, 0x9E, - 0x84, 0xCF, 0x85, 0x00, 0x85, 0x31, 0x85, 0x62, 0x85, 0x93, 0x85, 0xC3, 0x85, 0xF4, 0x86, 0x24, - 0x86, 0x55, 0x86, 0x85, 0x86, 0xB5, 0x86, 0xE6, 0x87, 0x16, 0x87, 0x46, 0x87, 0x76, 0x87, 0xA5, - 0x87, 0xD5, 0x88, 0x05, 0x88, 0x34, 0x88, 0x64, 0x88, 0x93, 0x88, 0xC3, 0x88, 0xF2, 0x89, 0x21, - 0x89, 0x50, 0x89, 0x7F, 0x89, 0xAE, 0x89, 0xDD, 0x8A, 0x0C, 0x8A, 0x3B, 0x8A, 0x69, 0x8A, 0x98, - 0x8A, 0xC6, 0x8A, 0xF5, 0x8B, 0x23, 0x8B, 0x51, 0x8B, 0x7F, 0x8B, 0xAE, 0x8B, 0xDC, 0x8C, 0x09, - 0x8C, 0x37, 0x8C, 0x65, 0x8C, 0x93, 0x8C, 0xC1, 0x8C, 0xEE, 0x8D, 0x1C, 0x8D, 0x49, 0x8D, 0x76, + 0x00, 0x00, 0x00, 0x80, // Size + 0x61, 0x62, 0x63, 0x64, // CmmType + 0x04, 0x30, 0x00, 0x00, // Version + 0x6D, 0x6E, 0x74, 0x72, // Class + 0x68, 0x45, 0x8D, 0x6A, // DataColorSpace + 0x58, 0x59, 0x5A, 0x20, // ProfileConnectionSpace + 0x07, 0xC6, 0x00, 0x0B, 0x00, 0x1A, 0x00, 0x07, 0x00, 0x15, 0x00, 0x2A, // CreationDate + 0x61, 0x63, 0x73, 0x70, // FileSignature + 0x4D, 0x53, 0x46, 0x54, // PrimaryPlatformSignature + 0x00, 0x00, 0x00, 0x01, // Flags + 0x07, 0x5B, 0xCD, 0x15, // DeviceManufacturer + 0x3A, 0xDE, 0x68, 0xB1, // DeviceModel + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, // DeviceAttributes + 0x00, 0x00, 0x00, 0x03, // RenderingIntent + 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, // PcsIlluminant + 0x64, 0x63, 0x62, 0x61, // CreatorSignature + // Profile ID + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // Padding + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, }; - public static byte[] Header_Corrupt2_Array = + public static readonly byte[] Header_CorruptProfileConnectionSpace_Array = { - 0x23, 0x74, 0x6D, 0x6D, 0xB1, 0xBC, 0x28, 0xB2, 0x6D, 0x0B, 0xA3, 0x9C, 0x2D, 0x60, 0x6C, 0xB4, - 0x96, 0xF2, 0x31, 0x88, 0x6C, 0x67, 0x8B, 0xA9, 0x35, 0x31, 0x6C, 0x24, 0x81, 0xAE, 0x38, 0x64, - 0x6B, 0xE9, 0x78, 0xEC, 0x3B, 0x28, 0x6B, 0xB7, 0x71, 0x4F, 0x3D, 0x87, 0x6B, 0x8C, 0x6A, 0xC3, - 0x3F, 0x87, 0x6B, 0x68, 0x65, 0x33, 0x41, 0x30, 0x6B, 0x4A, 0x60, 0x8C, 0x42, 0x8C, 0x6B, 0x32, - 0x5C, 0xB8, 0x43, 0xA2, 0x6B, 0x1F, 0x59, 0xA4, 0x44, 0x79, 0x6B, 0x10, 0x57, 0x3B, 0x45, 0x1A, - 0x6B, 0x05, 0x55, 0x68, 0x45, 0x8D, 0x6A, 0xFE, 0x54, 0x15, 0x45, 0xDA, 0x6A, 0xF9, 0x53, 0x2A, - 0x46, 0x16, 0x6A, 0xF5, 0x52, 0x74, 0x46, 0x27, 0x6A, 0xF4, 0x52, 0x43, 0x46, 0x27, 0x6A, 0xF4, - 0x52, 0x43, 0x46, 0x27, 0x6A, 0xF4, 0x52, 0x43, 0x46, 0x27, 0x6A, 0xF4, 0x52, 0x43, 0x46, 0x27, + 0x00, 0x00, 0x00, 0x80, // Size + 0x62, 0x63, 0x64, 0x65, // CmmType + 0x04, 0x30, 0x00, 0x00, // Version + 0x6D, 0x6E, 0x74, 0x72, // Class + 0x52, 0x47, 0x42, 0x20, // DataColorSpace + 0x68, 0x45, 0x8D, 0x6A, // ProfileConnectionSpace + 0x07, 0xC6, 0x00, 0x0B, 0x00, 0x1A, 0x00, 0x07, 0x00, 0x15, 0x00, 0x2A, // CreationDate + 0x61, 0x63, 0x73, 0x70, // FileSignature + 0x4D, 0x53, 0x46, 0x54, // PrimaryPlatformSignature + 0x00, 0x00, 0x00, 0x01, // Flags + 0x07, 0x5B, 0xCD, 0x15, // DeviceManufacturer + 0x3A, 0xDE, 0x68, 0xB1, // DeviceModel + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, // DeviceAttributes + 0x00, 0x00, 0x00, 0x03, // RenderingIntent + 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, // PcsIlluminant + 0x64, 0x63, 0x62, 0x61, // CreatorSignature + // Profile ID + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // Padding + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, }; + public static readonly byte[] Header_CorruptRenderingIntent_Array = + { + 0x00, 0x00, 0x00, 0x80, // Size + 0x63, 0x64, 0x65, 0x66, // CmmType + 0x04, 0x30, 0x00, 0x00, // Version + 0x6D, 0x6E, 0x74, 0x72, // Class + 0x52, 0x47, 0x42, 0x20, // DataColorSpace + 0x58, 0x59, 0x5A, 0x20, // ProfileConnectionSpace + 0x07, 0xC6, 0x00, 0x0B, 0x00, 0x1A, 0x00, 0x07, 0x00, 0x15, 0x00, 0x2A, // CreationDate + 0x61, 0x63, 0x73, 0x70, // FileSignature + 0x4D, 0x53, 0x46, 0x54, // PrimaryPlatformSignature + 0x00, 0x00, 0x00, 0x01, // Flags + 0x07, 0x5B, 0xCD, 0x15, // DeviceManufacturer + 0x3A, 0xDE, 0x68, 0xB1, // DeviceModel + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, // DeviceAttributes + 0x33, 0x41, 0x30, 0x6B, // RenderingIntent + 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, // PcsIlluminant + 0x64, 0x63, 0x62, 0x61, // CreatorSignature + // Profile ID + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // Padding + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + }; + + public static readonly byte[] Header_DataTooSmall_Array = new byte[127]; + + public static readonly byte[] Header_InvalidSizeSmall_Array = CreateHeaderRandomArray(127, 0, Header_Random_Id_Array); + + public static readonly byte[] Header_InvalidSizeBig_Array = CreateHeaderRandomArray(50_000_000, 0, Header_Random_Id_Array); + + public static readonly byte[] Header_SizeBiggerThanData_Array = CreateHeaderRandomArray(160, 0, Header_Random_Id_Array); - public static object[][] ProfileIdTestData = + public static readonly object[][] ProfileIdTestData = { new object[] { Header_Random_Array, Header_Random_Id_Value }, new object[] { Profile_Random_Array, Profile_Random_Id_Value }, }; - public static object[][] ProfileValidityTestData = + public static readonly object[][] ProfileValidityTestData = { - new object[] { Header_Corrupt1_Array, false }, - new object[] { Header_Corrupt2_Array, false }, + new object[] { Header_CorruptDataColorSpace_Array, false }, + new object[] { Header_CorruptProfileConnectionSpace_Array, false }, + new object[] { Header_CorruptRenderingIntent_Array, false }, + new object[] { Header_DataTooSmall_Array, false }, + new object[] { Header_InvalidSizeSmall_Array, false }, + new object[] { Header_InvalidSizeBig_Array, false }, + new object[] { Header_SizeBiggerThanData_Array, false }, new object[] { Header_Random_Array, true }, }; } diff --git a/tests/ImageSharp.Tests/TestImages.cs b/tests/ImageSharp.Tests/TestImages.cs index 6d3a76e75..b0bdad8e5 100644 --- a/tests/ImageSharp.Tests/TestImages.cs +++ b/tests/ImageSharp.Tests/TestImages.cs @@ -144,6 +144,7 @@ namespace SixLabors.ImageSharp.Tests public const string NoEoiProgressive517 = "Jpg/issues/Issue517-No-EOI-Progressive.jpg"; public const string BadRstProgressive518 = "Jpg/issues/Issue518-Bad-RST-Progressive.jpg"; public const string InvalidCast520 = "Jpg/issues/Issue520-InvalidCast.jpg"; + public const string DhtHasWrongLength624 = "Jpg/issues/Issue624-DhtHasWrongLength-Progressive-N.jpg"; } public static readonly string[] All = Baseline.All.Concat(Progressive.All).ToArray(); diff --git a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/SolidProvider.cs b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/SolidProvider.cs index 70e762585..97ed30b99 100644 --- a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/SolidProvider.cs +++ b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/SolidProvider.cs @@ -4,8 +4,6 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Drawing; - using Xunit.Abstractions; namespace SixLabors.ImageSharp.Tests diff --git a/tests/ImageSharp.Tests/TestUtilities/Tests/ImageComparerTests.cs b/tests/ImageSharp.Tests/TestUtilities/Tests/ImageComparerTests.cs index b9fa70f22..c935a4b98 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Tests/ImageComparerTests.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Tests/ImageComparerTests.cs @@ -5,7 +5,6 @@ using Moq; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Transforms; using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison; using SixLabors.Primitives; diff --git a/tests/ImageSharp.Tests/TestUtilities/Tests/TestUtilityExtensionsTests.cs b/tests/ImageSharp.Tests/TestUtilities/Tests/TestUtilityExtensionsTests.cs index cab61bc59..6e8278276 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Tests/TestUtilityExtensionsTests.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Tests/TestUtilityExtensionsTests.cs @@ -7,15 +7,14 @@ using System.Linq; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.Memory; using Xunit; using Xunit.Abstractions; namespace SixLabors.ImageSharp.Tests { - using SixLabors.ImageSharp.Processing.Effects; - using SixLabors.Memory; - public class TestUtilityExtensionsTests { public TestUtilityExtensionsTests(ITestOutputHelper output) @@ -55,7 +54,7 @@ namespace SixLabors.ImageSharp.Tests where TPixel : struct, IPixel { Image a = provider.GetImage(); - Image b = provider.GetImage(x=>x.OilPaint(3, 2)); + Image b = provider.GetImage(x => x.OilPaint(3, 2)); Assert.False(a.IsEquivalentTo(b, compareAlpha)); } diff --git a/tests/Images/External b/tests/Images/External index d9d93bbdd..98fb7e2e4 160000 --- a/tests/Images/External +++ b/tests/Images/External @@ -1 +1 @@ -Subproject commit d9d93bbdd18dd7b818c0d19cc8f967be98045d3c +Subproject commit 98fb7e2e4d5935b1c733bd2b206b6145b71ef378 diff --git a/tests/Images/Input/Jpg/issues/Issue624-DhtHasWrongLength-Progressive-N.jpg b/tests/Images/Input/Jpg/issues/Issue624-DhtHasWrongLength-Progressive-N.jpg new file mode 100644 index 000000000..2077b7518 Binary files /dev/null and b/tests/Images/Input/Jpg/issues/Issue624-DhtHasWrongLength-Progressive-N.jpg differ