diff --git a/packages.xml b/packages.xml new file mode 100644 index 0000000000..c7ff4de4cd --- /dev/null +++ b/packages.xml @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/ChangeDefaultEncoderOptions/Program.cs b/samples/ChangeDefaultEncoderOptions/Program.cs index d4541043f9..a8fbd75993 100644 --- a/samples/ChangeDefaultEncoderOptions/Program.cs +++ b/samples/ChangeDefaultEncoderOptions/Program.cs @@ -3,7 +3,7 @@ using System; using SixLabors.ImageSharp; -using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.Formats.Jpeg; namespace ChangeDefaultEncoderOptions { diff --git a/src/ImageSharp.Drawing/Brushes/IBrush.cs b/src/ImageSharp.Drawing/Brushes/IBrush.cs index 80393a08c1..8b163d7f67 100644 --- a/src/ImageSharp.Drawing/Brushes/IBrush.cs +++ b/src/ImageSharp.Drawing/Brushes/IBrush.cs @@ -1,11 +1,12 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using SixLabors.ImageSharp.Drawing.Brushes.Processors; using SixLabors.ImageSharp.Drawing.Processors; using SixLabors.ImageSharp.PixelFormats; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Drawing +namespace SixLabors.ImageSharp.Drawing.Brushes { /// /// Brush represents a logical configuration of a brush which can be used to source pixel colors diff --git a/src/ImageSharp.Drawing/Brushes/ImageBrush{TPixel}.cs b/src/ImageSharp.Drawing/Brushes/ImageBrush{TPixel}.cs index f04f16536d..593401777a 100644 --- a/src/ImageSharp.Drawing/Brushes/ImageBrush{TPixel}.cs +++ b/src/ImageSharp.Drawing/Brushes/ImageBrush{TPixel}.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. using System; +using SixLabors.ImageSharp.Drawing.Brushes.Processors; using SixLabors.ImageSharp.Drawing.Processors; using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.PixelFormats; diff --git a/src/ImageSharp.Drawing/Brushes/PatternBrush{TPixel}.cs b/src/ImageSharp.Drawing/Brushes/PatternBrush{TPixel}.cs index 8d3f74d6c6..d02baae841 100644 --- a/src/ImageSharp.Drawing/Brushes/PatternBrush{TPixel}.cs +++ b/src/ImageSharp.Drawing/Brushes/PatternBrush{TPixel}.cs @@ -3,6 +3,7 @@ using System; using System.Numerics; +using SixLabors.ImageSharp.Drawing.Brushes.Processors; using SixLabors.ImageSharp.Drawing.Processors; using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.PixelFormats; diff --git a/src/ImageSharp.Drawing/Brushes/Processors/BrushApplicator.cs b/src/ImageSharp.Drawing/Brushes/Processors/BrushApplicator.cs index 34f4201457..888c7acb09 100644 --- a/src/ImageSharp.Drawing/Brushes/Processors/BrushApplicator.cs +++ b/src/ImageSharp.Drawing/Brushes/Processors/BrushApplicator.cs @@ -5,7 +5,7 @@ using System; using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Drawing.Processors +namespace SixLabors.ImageSharp.Drawing.Brushes.Processors { /// /// primitive that converts a point in to a color for discovering the fill color based on an implementation diff --git a/src/ImageSharp.Drawing/Brushes/RecolorBrush{TPixel}.cs b/src/ImageSharp.Drawing/Brushes/RecolorBrush{TPixel}.cs index d0fa81db38..97eb56d30d 100644 --- a/src/ImageSharp.Drawing/Brushes/RecolorBrush{TPixel}.cs +++ b/src/ImageSharp.Drawing/Brushes/RecolorBrush{TPixel}.cs @@ -3,6 +3,7 @@ using System; using System.Numerics; +using SixLabors.ImageSharp.Drawing.Brushes.Processors; using SixLabors.ImageSharp.Drawing.Processors; using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.PixelFormats; diff --git a/src/ImageSharp.Drawing/Brushes/SolidBrush{TPixel}.cs b/src/ImageSharp.Drawing/Brushes/SolidBrush{TPixel}.cs index 22d8d805f5..cd8456a478 100644 --- a/src/ImageSharp.Drawing/Brushes/SolidBrush{TPixel}.cs +++ b/src/ImageSharp.Drawing/Brushes/SolidBrush{TPixel}.cs @@ -3,6 +3,7 @@ using System; using System.Numerics; +using SixLabors.ImageSharp.Drawing.Brushes.Processors; using SixLabors.ImageSharp.Drawing.Processors; using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.PixelFormats; diff --git a/src/ImageSharp.Drawing/Pens/IPen.cs b/src/ImageSharp.Drawing/Pens/IPen.cs index 3a87bbeb47..0680ec2f56 100644 --- a/src/ImageSharp.Drawing/Pens/IPen.cs +++ b/src/ImageSharp.Drawing/Pens/IPen.cs @@ -1,6 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using SixLabors.ImageSharp.Drawing.Brushes; using SixLabors.ImageSharp.Drawing.Processors; using SixLabors.ImageSharp.PixelFormats; diff --git a/src/ImageSharp.Drawing/Pens/Pens.cs b/src/ImageSharp.Drawing/Pens/Pens.cs index c90e1b8329..6478b1b813 100644 --- a/src/ImageSharp.Drawing/Pens/Pens.cs +++ b/src/ImageSharp.Drawing/Pens/Pens.cs @@ -1,6 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using SixLabors.ImageSharp.Drawing.Brushes; using SixLabors.ImageSharp.PixelFormats; namespace SixLabors.ImageSharp.Drawing.Pens diff --git a/src/ImageSharp.Drawing/PointInfo.cs b/src/ImageSharp.Drawing/PointInfo.cs deleted file mode 100644 index bdc1917a7b..0000000000 --- a/src/ImageSharp.Drawing/PointInfo.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Six Labors and contributors. -// Licensed under the Apache License, Version 2.0. - -namespace SixLabors.ImageSharp.Drawing -{ - /// - /// Returns details about how far away from the inside of a shape and the color the pixel could be. - /// - public struct PointInfo - { - /// - /// The distance along path - /// - public float DistanceAlongPath; - - /// - /// The distance from path - /// - public float DistanceFromPath; - } -} diff --git a/src/ImageSharp.Drawing/Processors/DrawImageProcessor.cs b/src/ImageSharp.Drawing/Processors/DrawImageProcessor.cs index 221cd9e39e..e1ce6b0133 100644 --- a/src/ImageSharp.Drawing/Processors/DrawImageProcessor.cs +++ b/src/ImageSharp.Drawing/Processors/DrawImageProcessor.cs @@ -94,7 +94,7 @@ namespace SixLabors.ImageSharp.Drawing.Processors Parallel.For( minY, maxY, - this.ParallelOptions, + source.Configuration.ParallelOptions, y => { Span background = sourcePixels.GetRowSpan(y).Slice(minX, width); diff --git a/src/ImageSharp.Drawing/Processors/FillProcessor.cs b/src/ImageSharp.Drawing/Processors/FillProcessor.cs index 66463b590d..fbd9654262 100644 --- a/src/ImageSharp.Drawing/Processors/FillProcessor.cs +++ b/src/ImageSharp.Drawing/Processors/FillProcessor.cs @@ -5,6 +5,8 @@ using System; using System.Numerics; using System.Threading.Tasks; using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.Drawing.Brushes; +using SixLabors.ImageSharp.Drawing.Brushes.Processors; using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; @@ -77,7 +79,7 @@ namespace SixLabors.ImageSharp.Drawing.Processors Parallel.For( minY, maxY, - this.ParallelOptions, + source.Configuration.ParallelOptions, y => { int offsetY = y - startY; diff --git a/src/ImageSharp.Drawing/Processors/FillRegionProcessor.cs b/src/ImageSharp.Drawing/Processors/FillRegionProcessor.cs index 7f7faa1111..3e0dedb3b0 100644 --- a/src/ImageSharp.Drawing/Processors/FillRegionProcessor.cs +++ b/src/ImageSharp.Drawing/Processors/FillRegionProcessor.cs @@ -5,6 +5,8 @@ using System; using System.Buffers; using System.Runtime.CompilerServices; using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.Drawing.Brushes; +using SixLabors.ImageSharp.Drawing.Brushes.Processors; using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; diff --git a/src/ImageSharp/ColorSpaces/IAlmostEquatable.cs b/src/ImageSharp/ColorSpaces/IAlmostEquatable.cs index 3f62f75acb..08c2dafbc6 100644 --- a/src/ImageSharp/ColorSpaces/IAlmostEquatable.cs +++ b/src/ImageSharp/ColorSpaces/IAlmostEquatable.cs @@ -11,7 +11,7 @@ namespace SixLabors.ImageSharp.ColorSpaces /// /// The type of objects to compare. /// The object specifying the type to specify precision with. - public interface IAlmostEquatable + internal interface IAlmostEquatable where TPrecision : struct, IComparable { /// diff --git a/src/ImageSharp/ColorSpaces/IColorVector.cs b/src/ImageSharp/ColorSpaces/IColorVector.cs index 3903e1c098..85c040b868 100644 --- a/src/ImageSharp/ColorSpaces/IColorVector.cs +++ b/src/ImageSharp/ColorSpaces/IColorVector.cs @@ -8,7 +8,7 @@ namespace SixLabors.ImageSharp.ColorSpaces /// /// Color represented as a vector in its color space /// - public interface IColorVector + internal interface IColorVector { /// /// Gets the vector representation of the color diff --git a/src/ImageSharp/Common/Extensions/EnumerableExtensions.cs b/src/ImageSharp/Common/Extensions/EnumerableExtensions.cs index f20f1a63e0..e97a2eaed0 100644 --- a/src/ImageSharp/Common/Extensions/EnumerableExtensions.cs +++ b/src/ImageSharp/Common/Extensions/EnumerableExtensions.cs @@ -4,12 +4,12 @@ using System; using System.Collections.Generic; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.Common { /// /// Encapsulates a series of time saving extension methods to the interface. /// - public static class EnumerableExtensions + internal static class EnumerableExtensions { /// /// Generates a sequence of integral numbers within a specified range. diff --git a/src/ImageSharp/Configuration.cs b/src/ImageSharp/Configuration.cs index 8e70c77164..a25f2573d8 100644 --- a/src/ImageSharp/Configuration.cs +++ b/src/ImageSharp/Configuration.cs @@ -7,6 +7,10 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.Formats.Bmp; +using SixLabors.ImageSharp.Formats.Gif; +using SixLabors.ImageSharp.Formats.Jpeg; +using SixLabors.ImageSharp.Formats.Png; using SixLabors.ImageSharp.IO; namespace SixLabors.ImageSharp diff --git a/src/ImageSharp/Dithering/ErrorDiffusion/Atkinson.cs b/src/ImageSharp/Dithering/ErrorDiffusion/AtkinsonDiffuser.cs similarity index 84% rename from src/ImageSharp/Dithering/ErrorDiffusion/Atkinson.cs rename to src/ImageSharp/Dithering/ErrorDiffusion/AtkinsonDiffuser.cs index dc15cdcd35..3899b14cc9 100644 --- a/src/ImageSharp/Dithering/ErrorDiffusion/Atkinson.cs +++ b/src/ImageSharp/Dithering/ErrorDiffusion/AtkinsonDiffuser.cs @@ -1,6 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using SixLabors.ImageSharp.Dithering.Base; using SixLabors.ImageSharp.Memory; namespace SixLabors.ImageSharp.Dithering @@ -9,7 +10,7 @@ namespace SixLabors.ImageSharp.Dithering /// Applies error diffusion based dithering using the Atkinson image dithering algorithm. /// /// - public sealed class Atkinson : ErrorDiffuser + public sealed class AtkinsonDiffuser : ErrorDiffuserBase { /// /// The diffusion matrix @@ -23,9 +24,9 @@ namespace SixLabors.ImageSharp.Dithering }; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public Atkinson() + public AtkinsonDiffuser() : base(AtkinsonMatrix, 8) { } diff --git a/src/ImageSharp/Dithering/ErrorDiffusion/Burks.cs b/src/ImageSharp/Dithering/ErrorDiffusion/BurksDiffuser.cs similarity index 78% rename from src/ImageSharp/Dithering/ErrorDiffusion/Burks.cs rename to src/ImageSharp/Dithering/ErrorDiffusion/BurksDiffuser.cs index 66697aab76..4d9f4d3c4f 100644 --- a/src/ImageSharp/Dithering/ErrorDiffusion/Burks.cs +++ b/src/ImageSharp/Dithering/ErrorDiffusion/BurksDiffuser.cs @@ -1,6 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using SixLabors.ImageSharp.Dithering.Base; using SixLabors.ImageSharp.Memory; namespace SixLabors.ImageSharp.Dithering @@ -9,7 +10,7 @@ namespace SixLabors.ImageSharp.Dithering /// Applies error diffusion based dithering using the Burks image dithering algorithm. /// /// - public sealed class Burks : ErrorDiffuser + public sealed class BurksDiffuser : ErrorDiffuserBase { /// /// The diffusion matrix @@ -22,9 +23,9 @@ namespace SixLabors.ImageSharp.Dithering }; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public Burks() + public BurksDiffuser() : base(BurksMatrix, 32) { } diff --git a/src/ImageSharp/Dithering/ErrorDiffusion/ErrorDiffuser.cs b/src/ImageSharp/Dithering/ErrorDiffusion/ErrorDiffuserBase.cs similarity index 87% rename from src/ImageSharp/Dithering/ErrorDiffusion/ErrorDiffuser.cs rename to src/ImageSharp/Dithering/ErrorDiffusion/ErrorDiffuserBase.cs index 8d05bfcb64..36029335ce 100644 --- a/src/ImageSharp/Dithering/ErrorDiffusion/ErrorDiffuser.cs +++ b/src/ImageSharp/Dithering/ErrorDiffusion/ErrorDiffuserBase.cs @@ -7,12 +7,12 @@ using System.Runtime.CompilerServices; using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Dithering +namespace SixLabors.ImageSharp.Dithering.Base { /// /// The base class for performing error diffusion based dithering. /// - public abstract class ErrorDiffuser : IErrorDiffuser + public abstract class ErrorDiffuserBase : IErrorDiffuser { /// /// The vector to perform division. @@ -40,11 +40,11 @@ namespace SixLabors.ImageSharp.Dithering private readonly Fast2DArray matrix; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The dithering matrix. /// The divisor. - internal ErrorDiffuser(Fast2DArray matrix, byte divisor) + internal ErrorDiffuserBase(Fast2DArray matrix, byte divisor) { Guard.NotNull(matrix, nameof(matrix)); Guard.MustBeGreaterThan(divisor, 0, nameof(divisor)); @@ -69,15 +69,15 @@ namespace SixLabors.ImageSharp.Dithering /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Dither(ImageBase pixels, TPixel source, TPixel transformed, int x, int y, int width, int height) + public void Dither(ImageBase pixels, TPixel source, TPixel transformed, int x, int y, int minX, int minY, int maxX, int maxY) where TPixel : struct, IPixel { - this.Dither(pixels, source, transformed, x, y, width, height, true); + this.Dither(pixels, source, transformed, x, y, minX, minY, maxX, maxY, true); } /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Dither(ImageBase image, TPixel source, TPixel transformed, int x, int y, int width, int height, bool replacePixel) + public void Dither(ImageBase image, TPixel source, TPixel transformed, int x, int y, int minX, int minY, int maxX, int maxY, bool replacePixel) where TPixel : struct, IPixel { if (replacePixel) @@ -93,7 +93,7 @@ namespace SixLabors.ImageSharp.Dithering for (int row = 0; row < this.matrixHeight; row++) { int matrixY = y + row; - if (matrixY > 0 && matrixY < height) + if (matrixY > minY && matrixY < maxY) { Span rowSpan = image.GetRowSpan(matrixY); @@ -101,7 +101,7 @@ namespace SixLabors.ImageSharp.Dithering { int matrixX = x + (col - this.startingOffset); - if (matrixX > 0 && matrixX < width) + if (matrixX > minX && matrixX < maxX) { float coefficient = this.matrix[row, col]; diff --git a/src/ImageSharp/Dithering/ErrorDiffusion/FloydSteinberg.cs b/src/ImageSharp/Dithering/ErrorDiffusion/FloydSteinbergDiffuser.cs similarity index 82% rename from src/ImageSharp/Dithering/ErrorDiffusion/FloydSteinberg.cs rename to src/ImageSharp/Dithering/ErrorDiffusion/FloydSteinbergDiffuser.cs index 5422d83bb8..6457fbe01e 100644 --- a/src/ImageSharp/Dithering/ErrorDiffusion/FloydSteinberg.cs +++ b/src/ImageSharp/Dithering/ErrorDiffusion/FloydSteinbergDiffuser.cs @@ -1,6 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using SixLabors.ImageSharp.Dithering.Base; using SixLabors.ImageSharp.Memory; namespace SixLabors.ImageSharp.Dithering @@ -9,7 +10,7 @@ namespace SixLabors.ImageSharp.Dithering /// Applies error diffusion based dithering using the Floyd–Steinberg image dithering algorithm. /// /// - public sealed class FloydSteinberg : ErrorDiffuser + public sealed class FloydSteinbergDiffuser : ErrorDiffuserBase { /// /// The diffusion matrix @@ -22,9 +23,9 @@ namespace SixLabors.ImageSharp.Dithering }; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public FloydSteinberg() + public FloydSteinbergDiffuser() : base(FloydSteinbergMatrix, 16) { } diff --git a/src/ImageSharp/Dithering/ErrorDiffusion/IErrorDiffuser.cs b/src/ImageSharp/Dithering/ErrorDiffusion/IErrorDiffuser.cs index 57eea6b921..850c978fef 100644 --- a/src/ImageSharp/Dithering/ErrorDiffusion/IErrorDiffuser.cs +++ b/src/ImageSharp/Dithering/ErrorDiffusion/IErrorDiffuser.cs @@ -18,10 +18,12 @@ namespace SixLabors.ImageSharp.Dithering /// The transformed pixel /// The column index. /// The row index. - /// The image width. - /// The image height. + /// The minimum column value. + /// The minimum row value. + /// The maximum column value. + /// The maximum row value. /// The pixel format. - void Dither(ImageBase image, TPixel source, TPixel transformed, int x, int y, int width, int height) + void Dither(ImageBase image, TPixel source, TPixel transformed, int x, int y, int minX, int minY, int maxX, int maxY) where TPixel : struct, IPixel; /// @@ -32,14 +34,16 @@ namespace SixLabors.ImageSharp.Dithering /// The transformed pixel /// The column index. /// The row index. - /// The image width. - /// The image height. + /// The minimum column value. + /// The minimum row value. + /// The maximum column value. + /// The maximum row value. /// /// Whether to replace the pixel at the given coordinates with the transformed value. /// Generally this would be true for standard two-color dithering but when used in conjunction with color quantization this should be false. /// /// The pixel format. - void Dither(ImageBase image, TPixel source, TPixel transformed, int x, int y, int width, int height, bool replacePixel) + void Dither(ImageBase image, TPixel source, TPixel transformed, int x, int y, int minX, int minY, int maxX, int maxY, bool replacePixel) where TPixel : struct, IPixel; } } diff --git a/src/ImageSharp/Dithering/ErrorDiffusion/JarvisJudiceNinke.cs b/src/ImageSharp/Dithering/ErrorDiffusion/JarvisJudiceNinkeDiffuser.cs similarity index 82% rename from src/ImageSharp/Dithering/ErrorDiffusion/JarvisJudiceNinke.cs rename to src/ImageSharp/Dithering/ErrorDiffusion/JarvisJudiceNinkeDiffuser.cs index 637240a124..30e09b47a9 100644 --- a/src/ImageSharp/Dithering/ErrorDiffusion/JarvisJudiceNinke.cs +++ b/src/ImageSharp/Dithering/ErrorDiffusion/JarvisJudiceNinkeDiffuser.cs @@ -1,6 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using SixLabors.ImageSharp.Dithering.Base; using SixLabors.ImageSharp.Memory; namespace SixLabors.ImageSharp.Dithering @@ -9,7 +10,7 @@ namespace SixLabors.ImageSharp.Dithering /// Applies error diffusion based dithering using the JarvisJudiceNinke image dithering algorithm. /// /// - public sealed class JarvisJudiceNinke : ErrorDiffuser + public sealed class JarvisJudiceNinkeDiffuser : ErrorDiffuserBase { /// /// The diffusion matrix @@ -23,9 +24,9 @@ namespace SixLabors.ImageSharp.Dithering }; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public JarvisJudiceNinke() + public JarvisJudiceNinkeDiffuser() : base(JarvisJudiceNinkeMatrix, 48) { } diff --git a/src/ImageSharp/Dithering/ErrorDiffusion/Sierra2.cs b/src/ImageSharp/Dithering/ErrorDiffusion/Sierra2Diffuser.cs similarity index 84% rename from src/ImageSharp/Dithering/ErrorDiffusion/Sierra2.cs rename to src/ImageSharp/Dithering/ErrorDiffusion/Sierra2Diffuser.cs index db37b45afc..c472d25b0d 100644 --- a/src/ImageSharp/Dithering/ErrorDiffusion/Sierra2.cs +++ b/src/ImageSharp/Dithering/ErrorDiffusion/Sierra2Diffuser.cs @@ -1,6 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using SixLabors.ImageSharp.Dithering.Base; using SixLabors.ImageSharp.Memory; namespace SixLabors.ImageSharp.Dithering @@ -9,7 +10,7 @@ namespace SixLabors.ImageSharp.Dithering /// Applies error diffusion based dithering using the Sierra2 image dithering algorithm. /// /// - public sealed class Sierra2 : ErrorDiffuser + public sealed class Sierra2Diffuser : ErrorDiffuserBase { /// /// The diffusion matrix @@ -22,9 +23,9 @@ namespace SixLabors.ImageSharp.Dithering }; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public Sierra2() + public Sierra2Diffuser() : base(Sierra2Matrix, 16) { } diff --git a/src/ImageSharp/Dithering/ErrorDiffusion/Sierra3.cs b/src/ImageSharp/Dithering/ErrorDiffusion/Sierra3Diffuser.cs similarity index 84% rename from src/ImageSharp/Dithering/ErrorDiffusion/Sierra3.cs rename to src/ImageSharp/Dithering/ErrorDiffusion/Sierra3Diffuser.cs index f812fcdc30..c19ab2aaac 100644 --- a/src/ImageSharp/Dithering/ErrorDiffusion/Sierra3.cs +++ b/src/ImageSharp/Dithering/ErrorDiffusion/Sierra3Diffuser.cs @@ -1,6 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using SixLabors.ImageSharp.Dithering.Base; using SixLabors.ImageSharp.Memory; namespace SixLabors.ImageSharp.Dithering @@ -9,7 +10,7 @@ namespace SixLabors.ImageSharp.Dithering /// Applies error diffusion based dithering using the Sierra3 image dithering algorithm. /// /// - public sealed class Sierra3 : ErrorDiffuser + public sealed class Sierra3Diffuser : ErrorDiffuserBase { /// /// The diffusion matrix @@ -23,9 +24,9 @@ namespace SixLabors.ImageSharp.Dithering }; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public Sierra3() + public Sierra3Diffuser() : base(Sierra3Matrix, 32) { } diff --git a/src/ImageSharp/Dithering/ErrorDiffusion/SierraLite.cs b/src/ImageSharp/Dithering/ErrorDiffusion/SierraLiteDiffuser.cs similarity index 83% rename from src/ImageSharp/Dithering/ErrorDiffusion/SierraLite.cs rename to src/ImageSharp/Dithering/ErrorDiffusion/SierraLiteDiffuser.cs index 98af7b432b..263bae568a 100644 --- a/src/ImageSharp/Dithering/ErrorDiffusion/SierraLite.cs +++ b/src/ImageSharp/Dithering/ErrorDiffusion/SierraLiteDiffuser.cs @@ -1,6 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using SixLabors.ImageSharp.Dithering.Base; using SixLabors.ImageSharp.Memory; namespace SixLabors.ImageSharp.Dithering @@ -9,7 +10,7 @@ namespace SixLabors.ImageSharp.Dithering /// Applies error diffusion based dithering using the SierraLite image dithering algorithm. /// /// - public sealed class SierraLite : ErrorDiffuser + public sealed class SierraLiteDiffuser : ErrorDiffuserBase { /// /// The diffusion matrix @@ -22,9 +23,9 @@ namespace SixLabors.ImageSharp.Dithering }; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public SierraLite() + public SierraLiteDiffuser() : base(SierraLiteMatrix, 4) { } diff --git a/src/ImageSharp/Dithering/ErrorDiffusion/Stucki.cs b/src/ImageSharp/Dithering/ErrorDiffusion/StuckiDiffuser.cs similarity index 78% rename from src/ImageSharp/Dithering/ErrorDiffusion/Stucki.cs rename to src/ImageSharp/Dithering/ErrorDiffusion/StuckiDiffuser.cs index 2f94639be8..0717695065 100644 --- a/src/ImageSharp/Dithering/ErrorDiffusion/Stucki.cs +++ b/src/ImageSharp/Dithering/ErrorDiffusion/StuckiDiffuser.cs @@ -1,6 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using SixLabors.ImageSharp.Dithering.Base; using SixLabors.ImageSharp.Memory; namespace SixLabors.ImageSharp.Dithering @@ -9,7 +10,7 @@ namespace SixLabors.ImageSharp.Dithering /// Applies error diffusion based dithering using the Stucki image dithering algorithm. /// /// - public sealed class Stucki : ErrorDiffuser + public sealed class StuckiDiffuser : ErrorDiffuserBase { /// /// The diffusion matrix @@ -23,9 +24,9 @@ namespace SixLabors.ImageSharp.Dithering }; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public Stucki() + public StuckiDiffuser() : base(StuckiMatrix, 42) { } diff --git a/src/ImageSharp/Dithering/Ordered/Bayer.cs b/src/ImageSharp/Dithering/Ordered/BayerDither.cs similarity index 78% rename from src/ImageSharp/Dithering/Ordered/Bayer.cs rename to src/ImageSharp/Dithering/Ordered/BayerDither.cs index cfbdb0888a..685dca5fe8 100644 --- a/src/ImageSharp/Dithering/Ordered/Bayer.cs +++ b/src/ImageSharp/Dithering/Ordered/BayerDither.cs @@ -1,15 +1,16 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using SixLabors.ImageSharp.Dithering.Base; using SixLabors.ImageSharp.Memory; -namespace SixLabors.ImageSharp.Dithering.Ordered +namespace SixLabors.ImageSharp.Dithering { /// /// Applies error diffusion based dithering using the 4x4 Bayer dithering matrix. /// /// - public sealed class Bayer : OrderedDither4x4 + public sealed class BayerDither : OrderedDitherBase { /// /// The threshold matrix. @@ -25,9 +26,9 @@ namespace SixLabors.ImageSharp.Dithering.Ordered }; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public Bayer() + public BayerDither() : base(ThresholdMatrix) { } diff --git a/src/ImageSharp/Dithering/Ordered/IOrderedDither.cs b/src/ImageSharp/Dithering/Ordered/IOrderedDither.cs index fbd51a2539..e3c7c5cbaf 100644 --- a/src/ImageSharp/Dithering/Ordered/IOrderedDither.cs +++ b/src/ImageSharp/Dithering/Ordered/IOrderedDither.cs @@ -21,10 +21,8 @@ namespace SixLabors.ImageSharp.Dithering /// The component index to test the threshold against. Must range from 0 to 3. /// The column index. /// The row index. - /// The image width. - /// The image height. /// The pixel format. - void Dither(ImageBase image, TPixel source, TPixel upper, TPixel lower, byte[] bytes, int index, int x, int y, int width, int height) + void Dither(ImageBase image, TPixel source, TPixel upper, TPixel lower, byte[] bytes, int index, int x, int y) where TPixel : struct, IPixel; } } \ No newline at end of file diff --git a/src/ImageSharp/Dithering/Ordered/Ordered.cs b/src/ImageSharp/Dithering/Ordered/OrderedDither.cs similarity index 83% rename from src/ImageSharp/Dithering/Ordered/Ordered.cs rename to src/ImageSharp/Dithering/Ordered/OrderedDither.cs index 4b559c4e12..12968914d0 100644 --- a/src/ImageSharp/Dithering/Ordered/Ordered.cs +++ b/src/ImageSharp/Dithering/Ordered/OrderedDither.cs @@ -1,15 +1,16 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using SixLabors.ImageSharp.Dithering.Base; using SixLabors.ImageSharp.Memory; -namespace SixLabors.ImageSharp.Dithering.Ordered +namespace SixLabors.ImageSharp.Dithering { /// /// Applies error diffusion based dithering using the 4x4 ordered dithering matrix. /// /// - public sealed class Ordered : OrderedDither4x4 + public sealed class OrderedDither : OrderedDitherBase { /// /// The threshold matrix. @@ -25,9 +26,9 @@ namespace SixLabors.ImageSharp.Dithering.Ordered }; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public Ordered() + public OrderedDither() : base(ThresholdMatrix) { } diff --git a/src/ImageSharp/Dithering/Ordered/OrderedDither4x4.cs b/src/ImageSharp/Dithering/Ordered/OrderedDitherBase.cs similarity index 84% rename from src/ImageSharp/Dithering/Ordered/OrderedDither4x4.cs rename to src/ImageSharp/Dithering/Ordered/OrderedDitherBase.cs index 94292b7b51..6fa406bec8 100644 --- a/src/ImageSharp/Dithering/Ordered/OrderedDither4x4.cs +++ b/src/ImageSharp/Dithering/Ordered/OrderedDitherBase.cs @@ -4,12 +4,12 @@ using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Dithering.Ordered +namespace SixLabors.ImageSharp.Dithering.Base { /// /// The base class for performing ordered ditheroing using a 4x4 matrix. /// - public abstract class OrderedDither4x4 : IOrderedDither + public abstract class OrderedDitherBase : IOrderedDither { /// /// The dithering matrix @@ -17,16 +17,16 @@ namespace SixLabors.ImageSharp.Dithering.Ordered private Fast2DArray matrix; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The thresholding matrix. - internal OrderedDither4x4(Fast2DArray matrix) + internal OrderedDitherBase(Fast2DArray matrix) { this.matrix = matrix; } /// - public void Dither(ImageBase image, TPixel source, TPixel upper, TPixel lower, byte[] bytes, int index, int x, int y, int width, int height) + public void Dither(ImageBase image, TPixel source, TPixel upper, TPixel lower, byte[] bytes, int index, int x, int y) where TPixel : struct, IPixel { // TODO: This doesn't really cut it for me. diff --git a/src/ImageSharp/Formats/Bmp/BmpBitsPerPixel.cs b/src/ImageSharp/Formats/Bmp/BmpBitsPerPixel.cs index 5ea9baa164..d08487cf27 100644 --- a/src/ImageSharp/Formats/Bmp/BmpBitsPerPixel.cs +++ b/src/ImageSharp/Formats/Bmp/BmpBitsPerPixel.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Bmp { /// /// Enumerates the available bits per pixel for bitmap. diff --git a/src/ImageSharp/Formats/Bmp/BmpCompression.cs b/src/ImageSharp/Formats/Bmp/BmpCompression.cs index e2a73639d1..1280498acb 100644 --- a/src/ImageSharp/Formats/Bmp/BmpCompression.cs +++ b/src/ImageSharp/Formats/Bmp/BmpCompression.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Bmp { /// /// Defines how the compression type of the image data diff --git a/src/ImageSharp/Formats/Bmp/BmpConfigurationModule.cs b/src/ImageSharp/Formats/Bmp/BmpConfigurationModule.cs index 46340fa85f..7477cfdb8b 100644 --- a/src/ImageSharp/Formats/Bmp/BmpConfigurationModule.cs +++ b/src/ImageSharp/Formats/Bmp/BmpConfigurationModule.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Bmp { /// /// Registers the image encoders, decoders and mime type detectors for the bmp format. diff --git a/src/ImageSharp/Formats/Bmp/BmpConstants.cs b/src/ImageSharp/Formats/Bmp/BmpConstants.cs index 15187e9691..b7291bb99e 100644 --- a/src/ImageSharp/Formats/Bmp/BmpConstants.cs +++ b/src/ImageSharp/Formats/Bmp/BmpConstants.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Bmp { /// /// Defines constants relating to BMPs diff --git a/src/ImageSharp/Formats/Bmp/BmpDecoder.cs b/src/ImageSharp/Formats/Bmp/BmpDecoder.cs index 1b015f8e64..8b53194fdc 100644 --- a/src/ImageSharp/Formats/Bmp/BmpDecoder.cs +++ b/src/ImageSharp/Formats/Bmp/BmpDecoder.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using System.IO; using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Bmp { /// /// Image decoder for generating an image out of a Windows bitmap stream. diff --git a/src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs b/src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs index f26476222f..c464cae0e7 100644 --- a/src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs +++ b/src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs @@ -6,7 +6,7 @@ using System.Runtime.CompilerServices; using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Bmp { /// /// Performs the bmp decoding operation. @@ -120,11 +120,11 @@ namespace SixLabors.ImageSharp.Formats this.currentStream.Read(palette, 0, colorMapSize); } - if (this.infoHeader.Width > Image.MaxWidth || this.infoHeader.Height > Image.MaxHeight) + if (this.infoHeader.Width > int.MaxValue || this.infoHeader.Height > int.MaxValue) { throw new ArgumentOutOfRangeException( $"The input bitmap '{this.infoHeader.Width}x{this.infoHeader.Height}' is " - + $"bigger then the max allowed size '{Image.MaxWidth}x{Image.MaxHeight}'"); + + $"bigger then the max allowed size '{int.MaxValue}x{int.MaxValue}'"); } Image image = new Image(this.configuration, this.infoHeader.Width, this.infoHeader.Height); diff --git a/src/ImageSharp/Formats/Bmp/BmpEncoder.cs b/src/ImageSharp/Formats/Bmp/BmpEncoder.cs index a0db29d7a0..366afceb5f 100644 --- a/src/ImageSharp/Formats/Bmp/BmpEncoder.cs +++ b/src/ImageSharp/Formats/Bmp/BmpEncoder.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using System.IO; using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Bmp { /// /// Image encoder for writing an image to a stream as a Windows bitmap. diff --git a/src/ImageSharp/Formats/Bmp/BmpEncoderCore.cs b/src/ImageSharp/Formats/Bmp/BmpEncoderCore.cs index 67754a175a..7f49be12a0 100644 --- a/src/ImageSharp/Formats/Bmp/BmpEncoderCore.cs +++ b/src/ImageSharp/Formats/Bmp/BmpEncoderCore.cs @@ -6,7 +6,7 @@ using System.IO; using SixLabors.ImageSharp.IO; using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Bmp { /// /// Image encoder for writing an image to a stream as a Windows bitmap. diff --git a/src/ImageSharp/Formats/Bmp/BmpFileHeader.cs b/src/ImageSharp/Formats/Bmp/BmpFileHeader.cs index 7fe8cd458b..4255ecae49 100644 --- a/src/ImageSharp/Formats/Bmp/BmpFileHeader.cs +++ b/src/ImageSharp/Formats/Bmp/BmpFileHeader.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Bmp { /// /// Stores general information about the Bitmap file. diff --git a/src/ImageSharp/Formats/Bmp/BmpFormat.cs b/src/ImageSharp/Formats/Bmp/BmpFormat.cs index 447bf6cb0b..64c6574c1e 100644 --- a/src/ImageSharp/Formats/Bmp/BmpFormat.cs +++ b/src/ImageSharp/Formats/Bmp/BmpFormat.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Bmp { /// /// Registers the image encoders, decoders and mime type detectors for the bmp format. diff --git a/src/ImageSharp/Formats/Bmp/BmpImageFormatDetector.cs b/src/ImageSharp/Formats/Bmp/BmpImageFormatDetector.cs index 6bd1f9d289..39bbc4d67b 100644 --- a/src/ImageSharp/Formats/Bmp/BmpImageFormatDetector.cs +++ b/src/ImageSharp/Formats/Bmp/BmpImageFormatDetector.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Bmp { /// /// Detects bmp file headers diff --git a/src/ImageSharp/Formats/Bmp/BmpInfoHeader.cs b/src/ImageSharp/Formats/Bmp/BmpInfoHeader.cs index d5c9213131..1037a97f93 100644 --- a/src/ImageSharp/Formats/Bmp/BmpInfoHeader.cs +++ b/src/ImageSharp/Formats/Bmp/BmpInfoHeader.cs @@ -1,6 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Bmp { /// /// This block of bytes tells the application detailed information diff --git a/src/ImageSharp/Formats/Bmp/IBmpDecoderOptions.cs b/src/ImageSharp/Formats/Bmp/IBmpDecoderOptions.cs index 08b47c0e1c..920c9ce028 100644 --- a/src/ImageSharp/Formats/Bmp/IBmpDecoderOptions.cs +++ b/src/ImageSharp/Formats/Bmp/IBmpDecoderOptions.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using System.IO; using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Bmp { /// /// Image decoder options for decoding Windows bitmap streams. diff --git a/src/ImageSharp/Formats/Bmp/IBmpEncoderOptions.cs b/src/ImageSharp/Formats/Bmp/IBmpEncoderOptions.cs index c89b2b25c0..c4e219889d 100644 --- a/src/ImageSharp/Formats/Bmp/IBmpEncoderOptions.cs +++ b/src/ImageSharp/Formats/Bmp/IBmpEncoderOptions.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using System.IO; using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Bmp { /// /// Configuration options for use during bmp encoding diff --git a/src/ImageSharp/Formats/Bmp/ImageExtensions.cs b/src/ImageSharp/Formats/Bmp/ImageExtensions.cs index d80abb51e3..43cb94c3f4 100644 --- a/src/ImageSharp/Formats/Bmp/ImageExtensions.cs +++ b/src/ImageSharp/Formats/Bmp/ImageExtensions.cs @@ -4,6 +4,7 @@ using System; using System.IO; using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.Formats.Bmp; using SixLabors.ImageSharp.PixelFormats; namespace SixLabors.ImageSharp diff --git a/src/ImageSharp/Formats/Gif/DisposalMethod.cs b/src/ImageSharp/Formats/Gif/DisposalMethod.cs index 94cf820882..f553c204b7 100644 --- a/src/ImageSharp/Formats/Gif/DisposalMethod.cs +++ b/src/ImageSharp/Formats/Gif/DisposalMethod.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Gif { /// /// Provides enumeration for instructing the decoder what to do with the last image diff --git a/src/ImageSharp/Formats/Gif/GifConfigurationModule.cs b/src/ImageSharp/Formats/Gif/GifConfigurationModule.cs index 676363bbeb..4c42a833c0 100644 --- a/src/ImageSharp/Formats/Gif/GifConfigurationModule.cs +++ b/src/ImageSharp/Formats/Gif/GifConfigurationModule.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Gif { /// /// Registers the image encoders, decoders and mime type detectors for the gif format. diff --git a/src/ImageSharp/Formats/Gif/GifConstants.cs b/src/ImageSharp/Formats/Gif/GifConstants.cs index e65d33c72c..d448cf7838 100644 --- a/src/ImageSharp/Formats/Gif/GifConstants.cs +++ b/src/ImageSharp/Formats/Gif/GifConstants.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using System.Text; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Gif { /// /// Constants that define specific points within a gif. diff --git a/src/ImageSharp/Formats/Gif/GifDecoder.cs b/src/ImageSharp/Formats/Gif/GifDecoder.cs index 9322cec8d0..5ded251e2d 100644 --- a/src/ImageSharp/Formats/Gif/GifDecoder.cs +++ b/src/ImageSharp/Formats/Gif/GifDecoder.cs @@ -7,7 +7,7 @@ using System.IO; using System.Text; using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Gif { /// /// Decoder for generating an image out of a gif encoded stream. diff --git a/src/ImageSharp/Formats/Gif/GifDecoderCore.cs b/src/ImageSharp/Formats/Gif/GifDecoderCore.cs index 1547046582..f94cf0e731 100644 --- a/src/ImageSharp/Formats/Gif/GifDecoderCore.cs +++ b/src/ImageSharp/Formats/Gif/GifDecoderCore.cs @@ -6,10 +6,11 @@ using System.Buffers; using System.IO; using System.Runtime.CompilerServices; using System.Text; +using SixLabors.ImageSharp.MetaData; using SixLabors.ImageSharp.PixelFormats; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Gif { /// /// Performs the gif decoding operation. @@ -520,7 +521,7 @@ namespace SixLabors.ImageSharp.Formats /// /// The meta data. [MethodImpl(MethodImplOptions.AggressiveInlining)] - private void SetFrameMetaData(IMetaData metaData) + private void SetFrameMetaData(IFrameMetaData metaData) { if (this.graphicsControlExtension != null) { diff --git a/src/ImageSharp/Formats/Gif/GifEncoder.cs b/src/ImageSharp/Formats/Gif/GifEncoder.cs index 2dde83d9fe..2c3bb29299 100644 --- a/src/ImageSharp/Formats/Gif/GifEncoder.cs +++ b/src/ImageSharp/Formats/Gif/GifEncoder.cs @@ -8,7 +8,7 @@ using System.Text; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Quantizers; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Gif { /// /// Image encoder for writing image data to a stream in gif format. diff --git a/src/ImageSharp/Formats/Gif/GifEncoderCore.cs b/src/ImageSharp/Formats/Gif/GifEncoderCore.cs index 8105c695db..5022678384 100644 --- a/src/ImageSharp/Formats/Gif/GifEncoderCore.cs +++ b/src/ImageSharp/Formats/Gif/GifEncoderCore.cs @@ -7,10 +7,11 @@ using System.IO; using System.Linq; using System.Text; using SixLabors.ImageSharp.IO; +using SixLabors.ImageSharp.MetaData; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Quantizers; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Gif { /// /// Performs the gif encoding operation. @@ -287,7 +288,7 @@ namespace SixLabors.ImageSharp.Formats /// The metadata of the image or frame. /// The stream to write to. /// The index of the color in the color palette to make transparent. - private void WriteGraphicalControlExtension(IMetaData metaData, EndianBinaryWriter writer, int transparencyIndex) + private void WriteGraphicalControlExtension(IFrameMetaData metaData, EndianBinaryWriter writer, int transparencyIndex) { var extension = new GifGraphicsControlExtension { diff --git a/src/ImageSharp/Formats/Gif/GifFormat.cs b/src/ImageSharp/Formats/Gif/GifFormat.cs index 887081fc7a..6353690f47 100644 --- a/src/ImageSharp/Formats/Gif/GifFormat.cs +++ b/src/ImageSharp/Formats/Gif/GifFormat.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Gif { /// /// Registers the image encoders, decoders and mime type detectors for the gif format. diff --git a/src/ImageSharp/Formats/Gif/GifImageFormatDetector.cs b/src/ImageSharp/Formats/Gif/GifImageFormatDetector.cs index 7f908ad983..36346f6062 100644 --- a/src/ImageSharp/Formats/Gif/GifImageFormatDetector.cs +++ b/src/ImageSharp/Formats/Gif/GifImageFormatDetector.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Gif { /// /// Detects gif file headers diff --git a/src/ImageSharp/Formats/Gif/IGifDecoderOptions.cs b/src/ImageSharp/Formats/Gif/IGifDecoderOptions.cs index c5ba972de6..60c39f9362 100644 --- a/src/ImageSharp/Formats/Gif/IGifDecoderOptions.cs +++ b/src/ImageSharp/Formats/Gif/IGifDecoderOptions.cs @@ -7,7 +7,7 @@ using System.IO; using System.Text; using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Gif { /// /// Decoder for generating an image out of a gif encoded stream. diff --git a/src/ImageSharp/Formats/Gif/IGifEncoderOptions.cs b/src/ImageSharp/Formats/Gif/IGifEncoderOptions.cs index 1b8cf166e8..374dea6595 100644 --- a/src/ImageSharp/Formats/Gif/IGifEncoderOptions.cs +++ b/src/ImageSharp/Formats/Gif/IGifEncoderOptions.cs @@ -8,7 +8,7 @@ using System.Text; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Quantizers; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Gif { /// /// The configuration options used for encoding gifs diff --git a/src/ImageSharp/Formats/Gif/ImageExtensions.cs b/src/ImageSharp/Formats/Gif/ImageExtensions.cs index cfdd544c71..b5f358f583 100644 --- a/src/ImageSharp/Formats/Gif/ImageExtensions.cs +++ b/src/ImageSharp/Formats/Gif/ImageExtensions.cs @@ -4,6 +4,7 @@ using System; using System.IO; using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.Formats.Gif; using SixLabors.ImageSharp.PixelFormats; namespace SixLabors.ImageSharp diff --git a/src/ImageSharp/Formats/Gif/LzwDecoder.cs b/src/ImageSharp/Formats/Gif/LzwDecoder.cs index fcc50fe5c4..b8f12f930a 100644 --- a/src/ImageSharp/Formats/Gif/LzwDecoder.cs +++ b/src/ImageSharp/Formats/Gif/LzwDecoder.cs @@ -5,7 +5,7 @@ using System; using System.Buffers; using System.IO; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Gif { /// /// Decompresses and decodes data using the dynamic LZW algorithms. diff --git a/src/ImageSharp/Formats/Gif/LzwEncoder.cs b/src/ImageSharp/Formats/Gif/LzwEncoder.cs index e7865f9137..b7bfd0fd25 100644 --- a/src/ImageSharp/Formats/Gif/LzwEncoder.cs +++ b/src/ImageSharp/Formats/Gif/LzwEncoder.cs @@ -5,7 +5,7 @@ using System; using System.Buffers; using System.IO; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Gif { /// /// Encodes and compresses the image data using dynamic Lempel-Ziv compression. diff --git a/src/ImageSharp/Formats/Gif/PackedField.cs b/src/ImageSharp/Formats/Gif/PackedField.cs index d0489a13c7..962e2082bf 100644 --- a/src/ImageSharp/Formats/Gif/PackedField.cs +++ b/src/ImageSharp/Formats/Gif/PackedField.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Gif { /// /// Represents a byte of data in a GIF data stream which contains a number diff --git a/src/ImageSharp/Formats/Gif/Sections/GifGraphicsControlExtension.cs b/src/ImageSharp/Formats/Gif/Sections/GifGraphicsControlExtension.cs index 13a1fb6a8f..8cdd309d30 100644 --- a/src/ImageSharp/Formats/Gif/Sections/GifGraphicsControlExtension.cs +++ b/src/ImageSharp/Formats/Gif/Sections/GifGraphicsControlExtension.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Gif { /// /// The Graphic Control Extension contains parameters used when diff --git a/src/ImageSharp/Formats/Gif/Sections/GifImageDescriptor.cs b/src/ImageSharp/Formats/Gif/Sections/GifImageDescriptor.cs index 8765c9deaf..2ed9e47470 100644 --- a/src/ImageSharp/Formats/Gif/Sections/GifImageDescriptor.cs +++ b/src/ImageSharp/Formats/Gif/Sections/GifImageDescriptor.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Gif { /// /// Each image in the Data Stream is composed of an Image Descriptor, diff --git a/src/ImageSharp/Formats/Gif/Sections/GifLogicalScreenDescriptor.cs b/src/ImageSharp/Formats/Gif/Sections/GifLogicalScreenDescriptor.cs index 28983fa3f7..b1109c3e25 100644 --- a/src/ImageSharp/Formats/Gif/Sections/GifLogicalScreenDescriptor.cs +++ b/src/ImageSharp/Formats/Gif/Sections/GifLogicalScreenDescriptor.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Gif { /// /// The Logical Screen Descriptor contains the parameters diff --git a/src/ImageSharp/Formats/Jpeg/Common/UnzigData.cs b/src/ImageSharp/Formats/Jpeg/Common/UnzigData.cs index d781238278..aaefbb3af9 100644 --- a/src/ImageSharp/Formats/Jpeg/Common/UnzigData.cs +++ b/src/ImageSharp/Formats/Jpeg/Common/UnzigData.cs @@ -3,7 +3,7 @@ using System; using System.Runtime.InteropServices; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Jpeg.Common { /// /// Holds the Jpeg UnZig array in a value/stack type. diff --git a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/JpegBlockProcessor.cs b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/JpegBlockProcessor.cs index acff386149..ba4a421271 100644 --- a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/JpegBlockProcessor.cs +++ b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/JpegBlockProcessor.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. using System.Runtime.InteropServices; +using SixLabors.ImageSharp.Formats.Jpeg.Common; using SixLabors.ImageSharp.Memory; using Block8x8F = SixLabors.ImageSharp.Formats.Jpeg.Common.Block8x8F; diff --git a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/OldJpegScanDecoder.ComputationData.cs b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/OldJpegScanDecoder.ComputationData.cs index 268ae8cb52..8f999bbef2 100644 --- a/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/OldJpegScanDecoder.ComputationData.cs +++ b/src/ImageSharp/Formats/Jpeg/GolangPort/Components/Decoder/OldJpegScanDecoder.ComputationData.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. using System.Runtime.InteropServices; +using SixLabors.ImageSharp.Formats.Jpeg.Common; using Block8x8F = SixLabors.ImageSharp.Formats.Jpeg.Common.Block8x8F; namespace SixLabors.ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder diff --git a/src/ImageSharp/Formats/Jpeg/GolangPort/JpegEncoderCore.cs b/src/ImageSharp/Formats/Jpeg/GolangPort/JpegEncoderCore.cs index cb9d73bd0f..229b8b7b5a 100644 --- a/src/ImageSharp/Formats/Jpeg/GolangPort/JpegEncoderCore.cs +++ b/src/ImageSharp/Formats/Jpeg/GolangPort/JpegEncoderCore.cs @@ -4,9 +4,12 @@ using System.Buffers; using System.IO; using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.Formats.Jpeg.Common; using SixLabors.ImageSharp.Formats.Jpeg.GolangPort.Components; using SixLabors.ImageSharp.Formats.Jpeg.GolangPort.Components.Encoder; using SixLabors.ImageSharp.Formats.Jpeg.GolangPort.Utils; +using SixLabors.ImageSharp.MetaData.Profiles.Exif; +using SixLabors.ImageSharp.MetaData.Profiles.Icc; using SixLabors.ImageSharp.PixelFormats; using Block8x8F = SixLabors.ImageSharp.Formats.Jpeg.Common.Block8x8F; diff --git a/src/ImageSharp/Formats/Jpeg/GolangPort/OldJpegDecoderCore.cs b/src/ImageSharp/Formats/Jpeg/GolangPort/OldJpegDecoderCore.cs index dc6ff81476..765c5f39aa 100644 --- a/src/ImageSharp/Formats/Jpeg/GolangPort/OldJpegDecoderCore.cs +++ b/src/ImageSharp/Formats/Jpeg/GolangPort/OldJpegDecoderCore.cs @@ -7,6 +7,9 @@ using System.Runtime.CompilerServices; using System.Threading.Tasks; using SixLabors.ImageSharp.Formats.Jpeg.GolangPort.Components.Decoder; using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.MetaData; +using SixLabors.ImageSharp.MetaData.Profiles.Exif; +using SixLabors.ImageSharp.MetaData.Profiles.Icc; using SixLabors.ImageSharp.PixelFormats; using Block8x8F = SixLabors.ImageSharp.Formats.Jpeg.Common.Block8x8F; diff --git a/src/ImageSharp/Formats/Jpeg/IJpegDecoderOptions.cs b/src/ImageSharp/Formats/Jpeg/IJpegDecoderOptions.cs index 4cbd8379a7..880a7f7a3f 100644 --- a/src/ImageSharp/Formats/Jpeg/IJpegDecoderOptions.cs +++ b/src/ImageSharp/Formats/Jpeg/IJpegDecoderOptions.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using System.IO; using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Jpeg { /// /// Image decoder for generating an image out of a jpg stream. diff --git a/src/ImageSharp/Formats/Jpeg/IJpegEncoderOptions.cs b/src/ImageSharp/Formats/Jpeg/IJpegEncoderOptions.cs index 7867056bfc..a84652cefe 100644 --- a/src/ImageSharp/Formats/Jpeg/IJpegEncoderOptions.cs +++ b/src/ImageSharp/Formats/Jpeg/IJpegEncoderOptions.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using System.IO; using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Jpeg { /// /// Encoder for writing the data image to a stream in jpeg format. diff --git a/src/ImageSharp/Formats/Jpeg/ImageExtensions.cs b/src/ImageSharp/Formats/Jpeg/ImageExtensions.cs index e0ae0c5a39..c7d7b26da6 100644 --- a/src/ImageSharp/Formats/Jpeg/ImageExtensions.cs +++ b/src/ImageSharp/Formats/Jpeg/ImageExtensions.cs @@ -4,6 +4,7 @@ using System; using System.IO; using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.Formats.Jpeg; using SixLabors.ImageSharp.PixelFormats; namespace SixLabors.ImageSharp diff --git a/src/ImageSharp/Formats/Jpeg/JpegConfigurationModule.cs b/src/ImageSharp/Formats/Jpeg/JpegConfigurationModule.cs index 43f56caecd..1ab5093398 100644 --- a/src/ImageSharp/Formats/Jpeg/JpegConfigurationModule.cs +++ b/src/ImageSharp/Formats/Jpeg/JpegConfigurationModule.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Jpeg { /// /// Registers the image encoders, decoders and mime type detectors for the jpeg format. diff --git a/src/ImageSharp/Formats/Jpeg/JpegDecoder.cs b/src/ImageSharp/Formats/Jpeg/JpegDecoder.cs index dd185f26a5..38f1d7dbc7 100644 --- a/src/ImageSharp/Formats/Jpeg/JpegDecoder.cs +++ b/src/ImageSharp/Formats/Jpeg/JpegDecoder.cs @@ -5,7 +5,7 @@ using System.IO; using SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort; using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Jpeg { /// /// Image decoder for generating an image out of a jpg stream. diff --git a/src/ImageSharp/Formats/Jpeg/JpegEncoder.cs b/src/ImageSharp/Formats/Jpeg/JpegEncoder.cs index f95ba002bd..3d79faabce 100644 --- a/src/ImageSharp/Formats/Jpeg/JpegEncoder.cs +++ b/src/ImageSharp/Formats/Jpeg/JpegEncoder.cs @@ -5,7 +5,7 @@ using System.IO; using SixLabors.ImageSharp.Formats.Jpeg.GolangPort; using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Jpeg { /// /// Encoder for writing the data image to a stream in jpeg format. diff --git a/src/ImageSharp/Formats/Jpeg/JpegFormat.cs b/src/ImageSharp/Formats/Jpeg/JpegFormat.cs index 2b7cd79789..8dd59ac203 100644 --- a/src/ImageSharp/Formats/Jpeg/JpegFormat.cs +++ b/src/ImageSharp/Formats/Jpeg/JpegFormat.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using SixLabors.ImageSharp.Formats.Jpeg.GolangPort; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Jpeg { /// /// Registers the image encoders, decoders and mime type detectors for the jpeg format. diff --git a/src/ImageSharp/Formats/Jpeg/JpegImageFormatDetector.cs b/src/ImageSharp/Formats/Jpeg/JpegImageFormatDetector.cs index 32bd904f03..d888986f39 100644 --- a/src/ImageSharp/Formats/Jpeg/JpegImageFormatDetector.cs +++ b/src/ImageSharp/Formats/Jpeg/JpegImageFormatDetector.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Jpeg { /// /// Detects Jpeg file headers diff --git a/src/ImageSharp/Formats/Jpeg/JpegSubsample.cs b/src/ImageSharp/Formats/Jpeg/JpegSubsample.cs index 971a749314..8558157059 100644 --- a/src/ImageSharp/Formats/Jpeg/JpegSubsample.cs +++ b/src/ImageSharp/Formats/Jpeg/JpegSubsample.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Jpeg { /// /// Enumerates the chroma subsampling method applied to the image. diff --git a/src/ImageSharp/Formats/Jpeg/PdfJsPort/JpegDecoderCore.cs b/src/ImageSharp/Formats/Jpeg/PdfJsPort/JpegDecoderCore.cs index dcdde1feb7..95adb70fb9 100644 --- a/src/ImageSharp/Formats/Jpeg/PdfJsPort/JpegDecoderCore.cs +++ b/src/ImageSharp/Formats/Jpeg/PdfJsPort/JpegDecoderCore.cs @@ -6,6 +6,9 @@ using System.IO; using System.Runtime.CompilerServices; using SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort.Components; using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.MetaData; +using SixLabors.ImageSharp.MetaData.Profiles.Exif; +using SixLabors.ImageSharp.MetaData.Profiles.Icc; using SixLabors.ImageSharp.PixelFormats; namespace SixLabors.ImageSharp.Formats.Jpeg.PdfJsPort diff --git a/src/ImageSharp/Formats/Png/Filters/AverageFilter.cs b/src/ImageSharp/Formats/Png/Filters/AverageFilter.cs index 061fea8a40..d66aa06dd6 100644 --- a/src/ImageSharp/Formats/Png/Filters/AverageFilter.cs +++ b/src/ImageSharp/Formats/Png/Filters/AverageFilter.cs @@ -4,7 +4,7 @@ using System; using System.Runtime.CompilerServices; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Png.Filters { /// /// The Average filter uses the average of the two neighboring pixels (left and above) to predict diff --git a/src/ImageSharp/Formats/Png/Filters/FilterType.cs b/src/ImageSharp/Formats/Png/Filters/FilterType.cs index 33fc646568..83a005380a 100644 --- a/src/ImageSharp/Formats/Png/Filters/FilterType.cs +++ b/src/ImageSharp/Formats/Png/Filters/FilterType.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Png.Filters { /// /// Provides enumeration of the various PNG filter types. diff --git a/src/ImageSharp/Formats/Png/Filters/NoneFilter.cs b/src/ImageSharp/Formats/Png/Filters/NoneFilter.cs index be3c06d70b..0164ceafaa 100644 --- a/src/ImageSharp/Formats/Png/Filters/NoneFilter.cs +++ b/src/ImageSharp/Formats/Png/Filters/NoneFilter.cs @@ -5,7 +5,7 @@ using System; using System.Runtime.CompilerServices; using SixLabors.ImageSharp.Memory; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Png.Filters { /// /// The None filter, the scanline is transmitted unmodified; it is only necessary to diff --git a/src/ImageSharp/Formats/Png/Filters/PaethFilter.cs b/src/ImageSharp/Formats/Png/Filters/PaethFilter.cs index 6db580534c..5b41558cde 100644 --- a/src/ImageSharp/Formats/Png/Filters/PaethFilter.cs +++ b/src/ImageSharp/Formats/Png/Filters/PaethFilter.cs @@ -4,7 +4,7 @@ using System; using System.Runtime.CompilerServices; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Png.Filters { /// /// The Paeth filter computes a simple linear function of the three neighboring pixels (left, above, upper left), diff --git a/src/ImageSharp/Formats/Png/Filters/SubFilter.cs b/src/ImageSharp/Formats/Png/Filters/SubFilter.cs index 62cc57718b..43607dcdd0 100644 --- a/src/ImageSharp/Formats/Png/Filters/SubFilter.cs +++ b/src/ImageSharp/Formats/Png/Filters/SubFilter.cs @@ -4,7 +4,7 @@ using System; using System.Runtime.CompilerServices; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Png.Filters { /// /// The Sub filter transmits the difference between each byte and the value of the corresponding byte diff --git a/src/ImageSharp/Formats/Png/Filters/UpFilter.cs b/src/ImageSharp/Formats/Png/Filters/UpFilter.cs index a2051d33ff..12a566e32e 100644 --- a/src/ImageSharp/Formats/Png/Filters/UpFilter.cs +++ b/src/ImageSharp/Formats/Png/Filters/UpFilter.cs @@ -4,7 +4,7 @@ using System; using System.Runtime.CompilerServices; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Png.Filters { /// /// The Up filter is just like the Sub filter except that the pixel immediately above the current pixel, diff --git a/src/ImageSharp/Formats/Png/IPngDecoderOptions.cs b/src/ImageSharp/Formats/Png/IPngDecoderOptions.cs index c612a7159b..e51cc084b2 100644 --- a/src/ImageSharp/Formats/Png/IPngDecoderOptions.cs +++ b/src/ImageSharp/Formats/Png/IPngDecoderOptions.cs @@ -7,7 +7,7 @@ using System.IO; using System.Text; using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Png { /// /// The optioas for decoding png images diff --git a/src/ImageSharp/Formats/Png/IPngEncoderOptions.cs b/src/ImageSharp/Formats/Png/IPngEncoderOptions.cs index 73d7a393b4..6b4b05e311 100644 --- a/src/ImageSharp/Formats/Png/IPngEncoderOptions.cs +++ b/src/ImageSharp/Formats/Png/IPngEncoderOptions.cs @@ -6,7 +6,7 @@ using System.IO; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Quantizers; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Png { /// /// The options availible for manipulating the encoder pipeline diff --git a/src/ImageSharp/Formats/Png/ImageExtensions.cs b/src/ImageSharp/Formats/Png/ImageExtensions.cs index 70815e0faf..5d7539915c 100644 --- a/src/ImageSharp/Formats/Png/ImageExtensions.cs +++ b/src/ImageSharp/Formats/Png/ImageExtensions.cs @@ -3,6 +3,7 @@ using System.IO; using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.Formats.Png; using SixLabors.ImageSharp.PixelFormats; namespace SixLabors.ImageSharp diff --git a/src/ImageSharp/Formats/Png/PngChunk.cs b/src/ImageSharp/Formats/Png/PngChunk.cs index 9e7357f00a..f90def5b38 100644 --- a/src/ImageSharp/Formats/Png/PngChunk.cs +++ b/src/ImageSharp/Formats/Png/PngChunk.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Png { /// /// Stores header information about a chunk. diff --git a/src/ImageSharp/Formats/Png/PngChunkTypes.cs b/src/ImageSharp/Formats/Png/PngChunkTypes.cs index b501783d54..e22f4f0e7d 100644 --- a/src/ImageSharp/Formats/Png/PngChunkTypes.cs +++ b/src/ImageSharp/Formats/Png/PngChunkTypes.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Png { /// /// Contains a list of possible chunk type identifiers. diff --git a/src/ImageSharp/Formats/Png/PngColorType.cs b/src/ImageSharp/Formats/Png/PngColorType.cs index 093edaddd9..fc376ca161 100644 --- a/src/ImageSharp/Formats/Png/PngColorType.cs +++ b/src/ImageSharp/Formats/Png/PngColorType.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Png { /// /// Provides enumeration of available PNG color types. diff --git a/src/ImageSharp/Formats/Png/PngConfigurationModule.cs b/src/ImageSharp/Formats/Png/PngConfigurationModule.cs index c362e19529..9346f7567e 100644 --- a/src/ImageSharp/Formats/Png/PngConfigurationModule.cs +++ b/src/ImageSharp/Formats/Png/PngConfigurationModule.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Png { /// /// Registers the image encoders, decoders and mime type detectors for the png format. diff --git a/src/ImageSharp/Formats/Png/PngConstants.cs b/src/ImageSharp/Formats/Png/PngConstants.cs index 3c8992a540..8b4ad39f28 100644 --- a/src/ImageSharp/Formats/Png/PngConstants.cs +++ b/src/ImageSharp/Formats/Png/PngConstants.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using System.Text; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Png { /// /// Defines png constants defined in the specification. diff --git a/src/ImageSharp/Formats/Png/PngDecoder.cs b/src/ImageSharp/Formats/Png/PngDecoder.cs index da3a2f139c..786f3fe901 100644 --- a/src/ImageSharp/Formats/Png/PngDecoder.cs +++ b/src/ImageSharp/Formats/Png/PngDecoder.cs @@ -7,7 +7,7 @@ using System.IO; using System.Text; using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Png { /// /// Encoder for generating an image out of a png encoded stream. diff --git a/src/ImageSharp/Formats/Png/PngDecoderCore.cs b/src/ImageSharp/Formats/Png/PngDecoderCore.cs index 75ca69684a..2427da2572 100644 --- a/src/ImageSharp/Formats/Png/PngDecoderCore.cs +++ b/src/ImageSharp/Formats/Png/PngDecoderCore.cs @@ -8,11 +8,14 @@ using System.IO; using System.Linq; using System.Runtime.CompilerServices; using System.Text; +using SixLabors.ImageSharp.Formats.Png.Filters; +using SixLabors.ImageSharp.Formats.Png.Zlib; using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.MetaData; using SixLabors.ImageSharp.PixelFormats; using static SixLabors.ImageSharp.ComparableExtensions; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Png { /// /// Performs the png decoding operation. diff --git a/src/ImageSharp/Formats/Png/PngEncoder.cs b/src/ImageSharp/Formats/Png/PngEncoder.cs index 583d77a8ab..6b2410e837 100644 --- a/src/ImageSharp/Formats/Png/PngEncoder.cs +++ b/src/ImageSharp/Formats/Png/PngEncoder.cs @@ -6,7 +6,7 @@ using System.IO; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Quantizers; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Png { /// /// Image encoder for writing image data to a stream in png format. diff --git a/src/ImageSharp/Formats/Png/PngEncoderCore.cs b/src/ImageSharp/Formats/Png/PngEncoderCore.cs index cee62fde36..5e6e77316c 100644 --- a/src/ImageSharp/Formats/Png/PngEncoderCore.cs +++ b/src/ImageSharp/Formats/Png/PngEncoderCore.cs @@ -6,12 +6,14 @@ using System.Buffers; using System.IO; using System.Linq; using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.Formats.Png.Filters; +using SixLabors.ImageSharp.Formats.Png.Zlib; using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Quantizers; using static SixLabors.ImageSharp.ComparableExtensions; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Png { /// /// Performs the png encoding operation. diff --git a/src/ImageSharp/Formats/Png/PngFormat.cs b/src/ImageSharp/Formats/Png/PngFormat.cs index 9cfa660126..142f660712 100644 --- a/src/ImageSharp/Formats/Png/PngFormat.cs +++ b/src/ImageSharp/Formats/Png/PngFormat.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Png { /// /// Registers the image encoders, decoders and mime type detectors for the png format. diff --git a/src/ImageSharp/Formats/Png/PngHeader.cs b/src/ImageSharp/Formats/Png/PngHeader.cs index 3bbf10526a..a70032ce3c 100644 --- a/src/ImageSharp/Formats/Png/PngHeader.cs +++ b/src/ImageSharp/Formats/Png/PngHeader.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Png { /// /// Represents the png header chunk. diff --git a/src/ImageSharp/Formats/Png/PngImageFormatDetector.cs b/src/ImageSharp/Formats/Png/PngImageFormatDetector.cs index bf4a91caf2..837a147ed3 100644 --- a/src/ImageSharp/Formats/Png/PngImageFormatDetector.cs +++ b/src/ImageSharp/Formats/Png/PngImageFormatDetector.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Png { /// /// Detects png file headers diff --git a/src/ImageSharp/Formats/Png/PngInterlaceMode.cs b/src/ImageSharp/Formats/Png/PngInterlaceMode.cs index a39ccd6bed..10ebcc7bbe 100644 --- a/src/ImageSharp/Formats/Png/PngInterlaceMode.cs +++ b/src/ImageSharp/Formats/Png/PngInterlaceMode.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Png { /// /// Provides enumeration of available PNG interlace modes. diff --git a/src/ImageSharp/Formats/Png/Zlib/Adler32.cs b/src/ImageSharp/Formats/Png/Zlib/Adler32.cs index d0ddd84405..6841c1cb82 100644 --- a/src/ImageSharp/Formats/Png/Zlib/Adler32.cs +++ b/src/ImageSharp/Formats/Png/Zlib/Adler32.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Png.Zlib { /// /// Computes Adler32 checksum for a stream of data. An Adler32 diff --git a/src/ImageSharp/Formats/Png/Zlib/Crc32.cs b/src/ImageSharp/Formats/Png/Zlib/Crc32.cs index 7ca0f668b5..14a29b7aff 100644 --- a/src/ImageSharp/Formats/Png/Zlib/Crc32.cs +++ b/src/ImageSharp/Formats/Png/Zlib/Crc32.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Png.Zlib { /// /// Generate a table for a byte-wise 32-bit CRC calculation on the polynomial: diff --git a/src/ImageSharp/Formats/Png/Zlib/IChecksum.cs b/src/ImageSharp/Formats/Png/Zlib/IChecksum.cs index 4b656ab9cd..9d84258cae 100644 --- a/src/ImageSharp/Formats/Png/Zlib/IChecksum.cs +++ b/src/ImageSharp/Formats/Png/Zlib/IChecksum.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Png.Zlib { /// /// Interface to compute a data checksum used by checked input/output streams. diff --git a/src/ImageSharp/Formats/Png/Zlib/ZlibDeflateStream.cs b/src/ImageSharp/Formats/Png/Zlib/ZlibDeflateStream.cs index 11ddb10730..dd20886ff7 100644 --- a/src/ImageSharp/Formats/Png/Zlib/ZlibDeflateStream.cs +++ b/src/ImageSharp/Formats/Png/Zlib/ZlibDeflateStream.cs @@ -5,7 +5,7 @@ using System; using System.IO; using System.IO.Compression; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Png.Zlib { /// /// Provides methods and properties for compressing streams by using the Zlib Deflate algorithm. diff --git a/src/ImageSharp/Formats/Png/Zlib/ZlibInflateStream.cs b/src/ImageSharp/Formats/Png/Zlib/ZlibInflateStream.cs index d668ff4176..36d1d62e71 100644 --- a/src/ImageSharp/Formats/Png/Zlib/ZlibInflateStream.cs +++ b/src/ImageSharp/Formats/Png/Zlib/ZlibInflateStream.cs @@ -7,7 +7,7 @@ using System.IO; using System.IO.Compression; using System.Text; -namespace SixLabors.ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats.Png.Zlib { /// /// Provides methods and properties for deframing streams from PNGs. diff --git a/src/ImageSharp/IO/IFileSystem.cs b/src/ImageSharp/IO/IFileSystem.cs index 072c05ea7f..088d4abb8b 100644 --- a/src/ImageSharp/IO/IFileSystem.cs +++ b/src/ImageSharp/IO/IFileSystem.cs @@ -9,7 +9,7 @@ namespace SixLabors.ImageSharp.IO /// /// A simple interface representing the filesystem. /// - public interface IFileSystem + internal interface IFileSystem { /// /// Returns a readable stream as defined by the path. diff --git a/src/ImageSharp/IO/LocalFileSystem.cs b/src/ImageSharp/IO/LocalFileSystem.cs index 9c419698ff..204f5f4e1e 100644 --- a/src/ImageSharp/IO/LocalFileSystem.cs +++ b/src/ImageSharp/IO/LocalFileSystem.cs @@ -12,7 +12,7 @@ namespace SixLabors.ImageSharp.IO /// /// A wrapper around the local File apis. /// - public class LocalFileSystem : IFileSystem + internal class LocalFileSystem : IFileSystem { /// public Stream OpenRead(string path) diff --git a/src/ImageSharp/Image/IImage.cs b/src/ImageSharp/Image/IImage.cs index 6e05757276..3223e20f75 100644 --- a/src/ImageSharp/Image/IImage.cs +++ b/src/ImageSharp/Image/IImage.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.MetaData; namespace SixLabors.ImageSharp { diff --git a/src/ImageSharp/Image/IImageFrame.cs b/src/ImageSharp/Image/IImageFrame.cs index 3d23d6e09a..31a8165887 100644 --- a/src/ImageSharp/Image/IImageFrame.cs +++ b/src/ImageSharp/Image/IImageFrame.cs @@ -1,6 +1,8 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using SixLabors.ImageSharp.MetaData; + namespace SixLabors.ImageSharp { /// diff --git a/src/ImageSharp/Image/IImageProcessor.cs b/src/ImageSharp/Image/IImageProcessor.cs index 5eec31b478..b81f08e150 100644 --- a/src/ImageSharp/Image/IImageProcessor.cs +++ b/src/ImageSharp/Image/IImageProcessor.cs @@ -1,12 +1,10 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; -using System.Threading.Tasks; using SixLabors.ImageSharp.PixelFormats; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing +namespace SixLabors.ImageSharp { /// /// Encapsulates methods to alter the pixels of an image. @@ -15,17 +13,6 @@ namespace SixLabors.ImageSharp.Processing public interface IImageProcessor where TPixel : struct, IPixel { - /// - /// Gets or sets the parallel options for processing tasks in parallel. - /// - ParallelOptions ParallelOptions { get; set; } - - /// - /// Gets or sets a value indicating whether to compress - /// or expand individual pixel colors the value on processing. - /// - bool Compand { get; set; } - /// /// Applies the process to the specified portion of the specified . /// diff --git a/src/ImageSharp/Image/ImageBase{TPixel}.cs b/src/ImageSharp/Image/ImageBase{TPixel}.cs index db8964fa31..783d5d5646 100644 --- a/src/ImageSharp/Image/ImageBase{TPixel}.cs +++ b/src/ImageSharp/Image/ImageBase{TPixel}.cs @@ -19,16 +19,6 @@ namespace SixLabors.ImageSharp public abstract class ImageBase : IImageBase where TPixel : struct, IPixel { - /// - /// Gets or sets the maximum allowable width in pixels. - /// - public const int MaxWidth = int.MaxValue; - - /// - /// Gets or sets the maximum allowable height in pixels. - /// - public const int MaxHeight = int.MaxValue; - #pragma warning disable SA1401 // Fields must be private /// /// The image pixels. Not private as Buffer2D requires an array in its constructor. @@ -186,7 +176,7 @@ namespace SixLabors.ImageSharp /// A new items which is a clone of the original. public ImageBase Clone() { - return this.CloneInternal(); + return this.CloneImageBase(); } /// @@ -266,7 +256,7 @@ namespace SixLabors.ImageSharp /// Clones the image /// /// A new items which is a clone of the original. - protected abstract ImageBase CloneInternal(); + protected abstract ImageBase CloneImageBase(); /// /// Copies the properties from the other . @@ -281,14 +271,6 @@ namespace SixLabors.ImageSharp this.Configuration = other.Configuration; } - /// - /// Releases any unmanaged resources from the inheriting class. - /// - protected virtual void ReleaseUnmanagedResources() - { - // TODO release unmanaged resources here - } - /// /// Disposes the object and frees resources for the Garbage Collector. /// @@ -300,8 +282,6 @@ namespace SixLabors.ImageSharp return; } - this.ReleaseUnmanagedResources(); - if (disposing) { this.ReturnPixels(); diff --git a/src/ImageSharp/Image/ImageFrame{TPixel}.cs b/src/ImageSharp/Image/ImageFrame{TPixel}.cs index 333fd9c5f2..bd5e272618 100644 --- a/src/ImageSharp/Image/ImageFrame{TPixel}.cs +++ b/src/ImageSharp/Image/ImageFrame{TPixel}.cs @@ -4,6 +4,7 @@ using System; using System.Numerics; using System.Threading.Tasks; +using SixLabors.ImageSharp.MetaData; using SixLabors.ImageSharp.PixelFormats; namespace SixLabors.ImageSharp @@ -136,7 +137,7 @@ namespace SixLabors.ImageSharp } /// - protected override ImageBase CloneInternal() + protected override ImageBase CloneImageBase() { return this.Clone(); } diff --git a/src/ImageSharp/Image/Image{TPixel}.cs b/src/ImageSharp/Image/Image{TPixel}.cs index 47ddfac210..900045dbad 100644 --- a/src/ImageSharp/Image/Image{TPixel}.cs +++ b/src/ImageSharp/Image/Image{TPixel}.cs @@ -9,6 +9,7 @@ using System.Numerics; using System.Text; using System.Threading.Tasks; using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.MetaData; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; using SixLabors.Primitives; @@ -201,7 +202,7 @@ namespace SixLabors.ImageSharp } /// - protected override ImageBase CloneInternal() + protected override ImageBase CloneImageBase() { return this.Clone(); } diff --git a/src/ImageSharp/ImageFormats.cs b/src/ImageSharp/ImageFormats.cs index d677839688..a866e1fa5d 100644 --- a/src/ImageSharp/ImageFormats.cs +++ b/src/ImageSharp/ImageFormats.cs @@ -2,6 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.Formats.Bmp; +using SixLabors.ImageSharp.Formats.Gif; +using SixLabors.ImageSharp.Formats.Jpeg; +using SixLabors.ImageSharp.Formats.Png; namespace SixLabors.ImageSharp { diff --git a/src/ImageSharp/MetaData/IMetaData.cs b/src/ImageSharp/MetaData/IFrameMetaData.cs similarity index 89% rename from src/ImageSharp/MetaData/IMetaData.cs rename to src/ImageSharp/MetaData/IFrameMetaData.cs index 61a906c03d..168b7802cf 100644 --- a/src/ImageSharp/MetaData/IMetaData.cs +++ b/src/ImageSharp/MetaData/IFrameMetaData.cs @@ -2,13 +2,14 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.Formats.Gif; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData { /// /// Encapsulates the metadata of an image frame. /// - internal interface IMetaData + internal interface IFrameMetaData { /// /// Gets or sets the frame delay for animated images. diff --git a/src/ImageSharp/MetaData/ImageFrameMetaData.cs b/src/ImageSharp/MetaData/ImageFrameMetaData.cs index 71051d11af..e5c2afa87e 100644 --- a/src/ImageSharp/MetaData/ImageFrameMetaData.cs +++ b/src/ImageSharp/MetaData/ImageFrameMetaData.cs @@ -2,13 +2,14 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.Formats.Gif; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData { /// /// Encapsulates the metadata of an image frame. /// - public sealed class ImageFrameMetaData : IMetaData + public sealed class ImageFrameMetaData : IFrameMetaData { /// /// Initializes a new instance of the class. diff --git a/src/ImageSharp/MetaData/ImageMetaData.cs b/src/ImageSharp/MetaData/ImageMetaData.cs index 5e99f30239..72af569452 100644 --- a/src/ImageSharp/MetaData/ImageMetaData.cs +++ b/src/ImageSharp/MetaData/ImageMetaData.cs @@ -3,13 +3,16 @@ using System.Collections.Generic; using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.Formats.Gif; +using SixLabors.ImageSharp.MetaData.Profiles.Exif; +using SixLabors.ImageSharp.MetaData.Profiles.Icc; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData { /// /// Encapsulates the metadata of an image. /// - public sealed class ImageMetaData : IMetaData + public sealed class ImageMetaData : IFrameMetaData { /// /// The default horizontal resolution value (dots per inch) in x direction. diff --git a/src/ImageSharp/MetaData/ImageProperty.cs b/src/ImageSharp/MetaData/ImageProperty.cs index 0c575cf260..62ae9d4790 100644 --- a/src/ImageSharp/MetaData/ImageProperty.cs +++ b/src/ImageSharp/MetaData/ImageProperty.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData { /// /// Stores meta information about a image, like the name of the author, diff --git a/src/ImageSharp/MetaData/Profiles/Exif/ExifDataType.cs b/src/ImageSharp/MetaData/Profiles/Exif/ExifDataType.cs index aa874df79a..8c3c1171c7 100644 --- a/src/ImageSharp/MetaData/Profiles/Exif/ExifDataType.cs +++ b/src/ImageSharp/MetaData/Profiles/Exif/ExifDataType.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Exif { /// /// Specifies exif data types. diff --git a/src/ImageSharp/MetaData/Profiles/Exif/ExifParts.cs b/src/ImageSharp/MetaData/Profiles/Exif/ExifParts.cs index 3bfa3281a3..b1b42ad433 100644 --- a/src/ImageSharp/MetaData/Profiles/Exif/ExifParts.cs +++ b/src/ImageSharp/MetaData/Profiles/Exif/ExifParts.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Exif { /// /// Specifies which parts will be written when the profile is added to an image. diff --git a/src/ImageSharp/MetaData/Profiles/Exif/ExifProfile.cs b/src/ImageSharp/MetaData/Profiles/Exif/ExifProfile.cs index fa18e96a23..f72753cc27 100644 --- a/src/ImageSharp/MetaData/Profiles/Exif/ExifProfile.cs +++ b/src/ImageSharp/MetaData/Profiles/Exif/ExifProfile.cs @@ -7,7 +7,7 @@ using System.Collections.ObjectModel; using System.IO; using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Exif { /// /// Represents an EXIF profile providing access to the collection of values. diff --git a/src/ImageSharp/MetaData/Profiles/Exif/ExifReader.cs b/src/ImageSharp/MetaData/Profiles/Exif/ExifReader.cs index d7d4c8b114..e247527a6e 100644 --- a/src/ImageSharp/MetaData/Profiles/Exif/ExifReader.cs +++ b/src/ImageSharp/MetaData/Profiles/Exif/ExifReader.cs @@ -6,7 +6,7 @@ using System.Collections.ObjectModel; using System.Linq; using System.Text; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Exif { /// /// Reads and parses EXIF data from a byte array diff --git a/src/ImageSharp/MetaData/Profiles/Exif/ExifTag.cs b/src/ImageSharp/MetaData/Profiles/Exif/ExifTag.cs index c6a9740568..5d2ef1436f 100644 --- a/src/ImageSharp/MetaData/Profiles/Exif/ExifTag.cs +++ b/src/ImageSharp/MetaData/Profiles/Exif/ExifTag.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Exif { /// /// All exif tags from the Exif standard 2.2 diff --git a/src/ImageSharp/MetaData/Profiles/Exif/ExifTagDescriptionAttribute.cs b/src/ImageSharp/MetaData/Profiles/Exif/ExifTagDescriptionAttribute.cs index 6135033254..4021227f57 100644 --- a/src/ImageSharp/MetaData/Profiles/Exif/ExifTagDescriptionAttribute.cs +++ b/src/ImageSharp/MetaData/Profiles/Exif/ExifTagDescriptionAttribute.cs @@ -4,7 +4,7 @@ using System; using System.Reflection; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Exif { /// /// Class that provides a description for an ExifTag value. diff --git a/src/ImageSharp/MetaData/Profiles/Exif/ExifValue.cs b/src/ImageSharp/MetaData/Profiles/Exif/ExifValue.cs index c20aa2cbc7..64508137b4 100644 --- a/src/ImageSharp/MetaData/Profiles/Exif/ExifValue.cs +++ b/src/ImageSharp/MetaData/Profiles/Exif/ExifValue.cs @@ -5,7 +5,7 @@ using System; using System.Globalization; using System.Text; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Exif { /// /// Represent the value of the EXIF profile. diff --git a/src/ImageSharp/MetaData/Profiles/Exif/ExifWriter.cs b/src/ImageSharp/MetaData/Profiles/Exif/ExifWriter.cs index 2156240224..7f4123225e 100644 --- a/src/ImageSharp/MetaData/Profiles/Exif/ExifWriter.cs +++ b/src/ImageSharp/MetaData/Profiles/Exif/ExifWriter.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Text; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Exif { /// /// Contains methods for writing EXIF metadata. diff --git a/src/ImageSharp/Numerics/LongRational.cs b/src/ImageSharp/MetaData/Profiles/Exif/LongRational.cs similarity index 99% rename from src/ImageSharp/Numerics/LongRational.cs rename to src/ImageSharp/MetaData/Profiles/Exif/LongRational.cs index 48494d6466..f9c16d57d4 100644 --- a/src/ImageSharp/Numerics/LongRational.cs +++ b/src/ImageSharp/MetaData/Profiles/Exif/LongRational.cs @@ -5,7 +5,7 @@ using System; using System.Globalization; using System.Text; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Exif { /// /// Represents a number that can be expressed as a fraction diff --git a/src/ImageSharp/Numerics/Rational.cs b/src/ImageSharp/MetaData/Profiles/Exif/Rational.cs similarity index 99% rename from src/ImageSharp/Numerics/Rational.cs rename to src/ImageSharp/MetaData/Profiles/Exif/Rational.cs index 03941b90d8..6d62a623f9 100644 --- a/src/ImageSharp/Numerics/Rational.cs +++ b/src/ImageSharp/MetaData/Profiles/Exif/Rational.cs @@ -4,7 +4,7 @@ using System; using System.Globalization; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Exif { /// /// Represents a number that can be expressed as a fraction. diff --git a/src/ImageSharp/Numerics/SignedRational.cs b/src/ImageSharp/MetaData/Profiles/Exif/SignedRational.cs similarity index 99% rename from src/ImageSharp/Numerics/SignedRational.cs rename to src/ImageSharp/MetaData/Profiles/Exif/SignedRational.cs index 8821bd28c6..f2fe359242 100644 --- a/src/ImageSharp/Numerics/SignedRational.cs +++ b/src/ImageSharp/MetaData/Profiles/Exif/SignedRational.cs @@ -4,7 +4,7 @@ using System; using System.Globalization; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Exif { /// /// Represents a number that can be expressed as a fraction. diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccCurveSegment.cs b/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccCurveSegment.cs index c1b30bc816..157453f1b1 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccCurveSegment.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccCurveSegment.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// A segment of a curve diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccFormulaCurveElement.cs b/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccFormulaCurveElement.cs index 44ec136d81..5d931039c8 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccFormulaCurveElement.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccFormulaCurveElement.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// A formula based curve segment diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccOneDimensionalCurve.cs b/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccOneDimensionalCurve.cs index 377d5d0808..d916486dbf 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccOneDimensionalCurve.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccOneDimensionalCurve.cs @@ -4,7 +4,7 @@ using System; using System.Linq; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// A one dimensional curve diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccParametricCurve.cs b/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccParametricCurve.cs index 870c994a8d..46aec49be6 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccParametricCurve.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccParametricCurve.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// A parametric curve diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccResponseCurve.cs b/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccResponseCurve.cs index 435d014926..ae9cd84b47 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccResponseCurve.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccResponseCurve.cs @@ -5,7 +5,7 @@ using System; using System.Linq; using System.Numerics; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// A response curve diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccSampledCurveElement.cs b/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccSampledCurveElement.cs index de3f348c75..572c4a8f7d 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccSampledCurveElement.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccSampledCurveElement.cs @@ -4,7 +4,7 @@ using System; using System.Linq; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// A sampled curve segment diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Curves.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Curves.cs index 6ea81f9cc6..0ea404ad9c 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Curves.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Curves.cs @@ -3,7 +3,7 @@ using System.Numerics; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Provides methods to read ICC data types diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Lut.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Lut.cs index 0c39cc7bfc..f9d56b0fff 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Lut.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Lut.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Provides methods to read ICC data types diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Matrix.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Matrix.cs index c209741875..495d73a784 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Matrix.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Matrix.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Provides methods to read ICC data types diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.MultiProcessElement.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.MultiProcessElement.cs index fd41ec5b67..2b39b1d6c6 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.MultiProcessElement.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.MultiProcessElement.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Provides methods to read ICC data types diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.NonPrimitives.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.NonPrimitives.cs index c4642ed25e..8b942498ae 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.NonPrimitives.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.NonPrimitives.cs @@ -4,7 +4,7 @@ using System; using System.Numerics; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Provides methods to read ICC data types diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Primitives.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Primitives.cs index 544a57c7ab..14f7f95703 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Primitives.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Primitives.cs @@ -4,7 +4,7 @@ using System; using System.Text; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Provides methods to read ICC data types diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.TagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.TagDataEntry.cs index c988c9198d..9d92d5341c 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.TagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.TagDataEntry.cs @@ -5,7 +5,7 @@ using System; using System.Globalization; using System.Numerics; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Provides methods to read ICC data types diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.cs index 8e269a474a..1fecd761a6 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.cs @@ -5,7 +5,7 @@ using System; using System.Text; using SixLabors.ImageSharp.IO; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Provides methods to read ICC data types diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Curves.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Curves.cs index 6cbb7148af..d5f5d5a9b6 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Curves.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Curves.cs @@ -3,7 +3,7 @@ using System.Numerics; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Provides methods to write ICC data types diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Lut.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Lut.cs index 0cfae36fc2..38a3dd457d 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Lut.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Lut.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Provides methods to write ICC data types diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Matrix.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Matrix.cs index 3f873d3b0f..0b7064cf93 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Matrix.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Matrix.cs @@ -4,7 +4,7 @@ using System.Numerics; using SixLabors.ImageSharp.Memory; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Provides methods to write ICC data types diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.MultiProcessElement.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.MultiProcessElement.cs index 2522aee805..48c6734aec 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.MultiProcessElement.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.MultiProcessElement.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Provides methods to write ICC data types diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.NonPrimitives.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.NonPrimitives.cs index 9f8d8d0579..791a94a339 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.NonPrimitives.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.NonPrimitives.cs @@ -4,7 +4,7 @@ using System; using System.Numerics; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Provides methods to write ICC data types diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Primitives.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Primitives.cs index eb5f7eddb3..bf39a08491 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Primitives.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Primitives.cs @@ -4,7 +4,7 @@ using System; using System.Text; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Provides methods to write ICC data types diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.TagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.TagDataEntry.cs index 8c0640cbdd..9ee4f00046 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.TagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.TagDataEntry.cs @@ -3,7 +3,7 @@ using System.Linq; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Provides methods to write ICC data types diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.cs index 6a0ddf6399..cfcc66c8e4 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.cs @@ -5,7 +5,7 @@ using System; using System.IO; using System.Text; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Provides methods to write ICC data types diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccClutDataType.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccClutDataType.cs index 021051b256..fe0c9b8b59 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccClutDataType.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccClutDataType.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Color lookup table data type diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccColorSpaceType.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccColorSpaceType.cs index 77967ad663..0913cda418 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccColorSpaceType.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccColorSpaceType.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Color Space Type diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccColorantEncoding.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccColorantEncoding.cs index 22c29d31d1..bec71e0dbc 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccColorantEncoding.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccColorantEncoding.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Colorant Encoding diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccCurveMeasurementEncodings.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccCurveMeasurementEncodings.cs index 6d5e1b6f74..cfd2671e94 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccCurveMeasurementEncodings.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccCurveMeasurementEncodings.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Curve Measurement Encodings diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccCurveSegmentSignature.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccCurveSegmentSignature.cs index d1c0f28434..e9b8cc26b8 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccCurveSegmentSignature.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccCurveSegmentSignature.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Curve Segment Signature diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccDataType.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccDataType.cs index 4fcca3f249..b13edb53f4 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccDataType.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccDataType.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Enumerates the basic data types as defined in ICC.1:2010 version 4.3.0.0 diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccDeviceAttribute.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccDeviceAttribute.cs index 131434cfdc..88cca866dc 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccDeviceAttribute.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccDeviceAttribute.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Device attributes. Can be combined with a logical OR diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccFormulaCurveType.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccFormulaCurveType.cs index 8810bbbb04..2a375b0d1c 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccFormulaCurveType.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccFormulaCurveType.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Formula curve segment type diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccMeasurementGeometry.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccMeasurementGeometry.cs index dc8db74629..fe6575c41b 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccMeasurementGeometry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccMeasurementGeometry.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Measurement Geometry diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccMultiProcessElementSignature.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccMultiProcessElementSignature.cs index 80c74952ab..fe5d309228 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccMultiProcessElementSignature.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccMultiProcessElementSignature.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Multi process element signature diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccParametricCurveType.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccParametricCurveType.cs index 563a40c901..374b4ad93b 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccParametricCurveType.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccParametricCurveType.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Formula curve segment type diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccPrimaryPlatformType.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccPrimaryPlatformType.cs index ee6f719109..1563078f72 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccPrimaryPlatformType.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccPrimaryPlatformType.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Enumerates the primary platform/operating system framework for which the profile was created diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccProfileClass.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccProfileClass.cs index dbb6d61ed6..71c27ca611 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccProfileClass.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccProfileClass.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Profile Class Name diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccProfileFlag.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccProfileFlag.cs index f149415d81..3758be34b7 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccProfileFlag.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccProfileFlag.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Profile flags. Can be combined with a logical OR. diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccProfileTag.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccProfileTag.cs index 7c71fe9a54..82b2969003 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccProfileTag.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccProfileTag.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. // ReSharper disable InconsistentNaming -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Enumerates the ICC Profile Tags as defined in ICC.1:2010 version 4.3.0.0 diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccRenderingIntent.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccRenderingIntent.cs index cfcb8312eb..e0504b24cb 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccRenderingIntent.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccRenderingIntent.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Rendering intent diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccScreeningFlag.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccScreeningFlag.cs index 422b752023..839ab8c6b1 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccScreeningFlag.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccScreeningFlag.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Screening flags. Can be combined with a logical OR. diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccScreeningSpotType.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccScreeningSpotType.cs index 02138be3b3..f1d73c6268 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccScreeningSpotType.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccScreeningSpotType.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Enumerates the screening spot types diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccSignatureName.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccSignatureName.cs index b929afd9a9..4773ab6c2a 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccSignatureName.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccSignatureName.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Signature Name diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccStandardIlluminant.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccStandardIlluminant.cs index c4482de1f1..fe0c406576 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccStandardIlluminant.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccStandardIlluminant.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Standard Illuminant diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccStandardObserver.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccStandardObserver.cs index cfbec77689..a393c258b2 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccStandardObserver.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccStandardObserver.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Standard Observer diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccTypeSignature.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccTypeSignature.cs index 2249341af2..1493ecc6bb 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccTypeSignature.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccTypeSignature.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Type Signature diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Exceptions/InvalidIccProfileException.cs b/src/ImageSharp/MetaData/Profiles/ICC/Exceptions/InvalidIccProfileException.cs index 13e20fd9d5..d867edbebb 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Exceptions/InvalidIccProfileException.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Exceptions/InvalidIccProfileException.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Represents an error that happened while reading or writing a corrupt/invalid ICC profile diff --git a/src/ImageSharp/MetaData/Profiles/ICC/IccProfile.cs b/src/ImageSharp/MetaData/Profiles/ICC/IccProfile.cs index 7f8ba391d8..df85b2ab8e 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/IccProfile.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/IccProfile.cs @@ -8,7 +8,7 @@ using System.Collections.Generic; using System.Security.Cryptography; #endif -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Represents an ICC profile diff --git a/src/ImageSharp/MetaData/Profiles/ICC/IccProfileHeader.cs b/src/ImageSharp/MetaData/Profiles/ICC/IccProfileHeader.cs index e08914a973..f91572cfe6 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/IccProfileHeader.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/IccProfileHeader.cs @@ -4,7 +4,7 @@ using System; using System.Numerics; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Contains all values of an ICC profile header diff --git a/src/ImageSharp/MetaData/Profiles/ICC/IccReader.cs b/src/ImageSharp/MetaData/Profiles/ICC/IccReader.cs index a01a0beac3..ea84113fd9 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/IccReader.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/IccReader.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Reads and parses ICC data from a byte array diff --git a/src/ImageSharp/MetaData/Profiles/ICC/IccTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/IccTagDataEntry.cs index 5bada6e772..4789a69fe7 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/IccTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/IccTagDataEntry.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// The data of an ICC tag entry diff --git a/src/ImageSharp/MetaData/Profiles/ICC/IccWriter.cs b/src/ImageSharp/MetaData/Profiles/ICC/IccWriter.cs index c7f39aff4d..d7221e8cf8 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/IccWriter.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/IccWriter.cs @@ -5,7 +5,7 @@ using System; using System.Collections.Generic; using System.Linq; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Contains methods for writing ICC profiles. diff --git a/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccBAcsProcessElement.cs b/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccBAcsProcessElement.cs index 566a9cff4e..09931a1f91 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccBAcsProcessElement.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccBAcsProcessElement.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// A placeholder (might be used for future ICC versions) diff --git a/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccClutProcessElement.cs b/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccClutProcessElement.cs index 2c93796630..384ae850f3 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccClutProcessElement.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccClutProcessElement.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// A CLUT (color lookup table) element to process data diff --git a/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccCurveSetProcessElement.cs b/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccCurveSetProcessElement.cs index e081c084e8..d04869548b 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccCurveSetProcessElement.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccCurveSetProcessElement.cs @@ -4,7 +4,7 @@ using System; using System.Linq; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// A set of curves to process data diff --git a/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccEAcsProcessElement.cs b/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccEAcsProcessElement.cs index c4a49eeb3f..7e0e1eda82 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccEAcsProcessElement.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccEAcsProcessElement.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// A placeholder (might be used for future ICC versions) diff --git a/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccMatrixProcessElement.cs b/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccMatrixProcessElement.cs index afe41c624c..642f766d56 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccMatrixProcessElement.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccMatrixProcessElement.cs @@ -5,7 +5,7 @@ using System; using System.Linq; using SixLabors.ImageSharp.Memory; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// A matrix element to process data diff --git a/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccMultiProcessElement.cs b/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccMultiProcessElement.cs index ebac2912b4..59acd0eb7f 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccMultiProcessElement.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccMultiProcessElement.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// An element to process data diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccChromaticityTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccChromaticityTagDataEntry.cs index a7a70c11bd..6d838558a2 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccChromaticityTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccChromaticityTagDataEntry.cs @@ -4,7 +4,7 @@ using System; using System.Linq; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// The chromaticity tag type provides basic chromaticity data diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccColorantOrderTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccColorantOrderTagDataEntry.cs index 654af027eb..56af95a169 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccColorantOrderTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccColorantOrderTagDataEntry.cs @@ -4,7 +4,7 @@ using System; using System.Linq; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// This tag specifies the laydown order in which colorants diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccColorantTableTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccColorantTableTagDataEntry.cs index 5adc7ca283..b04ee10d00 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccColorantTableTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccColorantTableTagDataEntry.cs @@ -4,7 +4,7 @@ using System; using System.Linq; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// The purpose of this tag is to identify the colorants used in diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccCrdInfoTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccCrdInfoTagDataEntry.cs index 431ffa887c..1e516ce7f0 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccCrdInfoTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccCrdInfoTagDataEntry.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// This type contains the PostScript product name to which this profile diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccCurveTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccCurveTagDataEntry.cs index 0ab80e5065..7f753ff7d5 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccCurveTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccCurveTagDataEntry.cs @@ -4,7 +4,7 @@ using System; using System.Linq; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// The type contains a one-dimensional table of double values. diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccDataTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccDataTagDataEntry.cs index f39330d6cd..3b17e29429 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccDataTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccDataTagDataEntry.cs @@ -5,7 +5,7 @@ using System; using System.Linq; using System.Text; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// The dataType is a simple data structure that contains diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccDateTimeTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccDateTimeTagDataEntry.cs index 4dc935b9b5..879c208c1e 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccDateTimeTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccDateTimeTagDataEntry.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// This type is a representation of the time and date. diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccFix16ArrayTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccFix16ArrayTagDataEntry.cs index d8d67465bb..23580fac6c 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccFix16ArrayTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccFix16ArrayTagDataEntry.cs @@ -4,7 +4,7 @@ using System; using System.Linq; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// This type represents an array of doubles (from 32bit fixed point values). diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLut16TagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLut16TagDataEntry.cs index fec50e3e3a..13e1463309 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLut16TagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLut16TagDataEntry.cs @@ -5,7 +5,7 @@ using System; using System.Linq; using System.Numerics; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// This structure represents a color transform using tables diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLut8TagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLut8TagDataEntry.cs index 89e5e38949..fd6d028eaa 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLut8TagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLut8TagDataEntry.cs @@ -5,7 +5,7 @@ using System; using System.Linq; using System.Numerics; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// This structure represents a color transform using tables diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLutAToBTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLutAToBTagDataEntry.cs index 17720dd5dd..faf9a45506 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLutAToBTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLutAToBTagDataEntry.cs @@ -5,7 +5,7 @@ using System; using System.Linq; using System.Numerics; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// This structure represents a color transform. diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLutBToATagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLutBToATagDataEntry.cs index 51566c4b0f..10ffca3356 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLutBToATagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLutBToATagDataEntry.cs @@ -5,7 +5,7 @@ using System; using System.Linq; using System.Numerics; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// This structure represents a color transform. diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccMeasurementTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccMeasurementTagDataEntry.cs index 31278da621..12010ea09c 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccMeasurementTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccMeasurementTagDataEntry.cs @@ -4,7 +4,7 @@ using System; using System.Numerics; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// The measurementType information refers only to the internal diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccMultiLocalizedUnicodeTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccMultiLocalizedUnicodeTagDataEntry.cs index bdf9162018..62792b44ee 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccMultiLocalizedUnicodeTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccMultiLocalizedUnicodeTagDataEntry.cs @@ -4,7 +4,7 @@ using System; using System.Linq; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// This tag structure contains a set of records each referencing diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccMultiProcessElementsTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccMultiProcessElementsTagDataEntry.cs index 954096f44f..437c6734bb 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccMultiProcessElementsTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccMultiProcessElementsTagDataEntry.cs @@ -4,7 +4,7 @@ using System; using System.Linq; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// This structure represents a color transform, containing diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccNamedColor2TagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccNamedColor2TagDataEntry.cs index e7a13c28a8..d3e73b0189 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccNamedColor2TagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccNamedColor2TagDataEntry.cs @@ -4,7 +4,7 @@ using System; using System.Linq; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// The namedColor2Type is a count value and array of structures diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccParametricCurveTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccParametricCurveTagDataEntry.cs index 3791083710..192be52a13 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccParametricCurveTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccParametricCurveTagDataEntry.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// The parametricCurveType describes a one-dimensional curve by diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccProfileSequenceDescTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccProfileSequenceDescTagDataEntry.cs index e4f6b2e28e..88aaa09768 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccProfileSequenceDescTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccProfileSequenceDescTagDataEntry.cs @@ -4,7 +4,7 @@ using System; using System.Linq; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// This type is an array of structures, each of which contains information diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccProfileSequenceIdentifierTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccProfileSequenceIdentifierTagDataEntry.cs index e980a9715c..7ef17d37ec 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccProfileSequenceIdentifierTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccProfileSequenceIdentifierTagDataEntry.cs @@ -4,7 +4,7 @@ using System; using System.Linq; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// This type is an array of structures, each of which contains information diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccResponseCurveSet16TagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccResponseCurveSet16TagDataEntry.cs index dd3f782957..7faad30f32 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccResponseCurveSet16TagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccResponseCurveSet16TagDataEntry.cs @@ -4,7 +4,7 @@ using System; using System.Linq; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// The purpose of this tag type is to provide a mechanism to relate physical diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccScreeningTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccScreeningTagDataEntry.cs index dad5d86587..7a5062707d 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccScreeningTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccScreeningTagDataEntry.cs @@ -4,7 +4,7 @@ using System; using System.Linq; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// This type describes various screening parameters including diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccSignatureTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccSignatureTagDataEntry.cs index a6367f55b8..82462afa3c 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccSignatureTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccSignatureTagDataEntry.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Typically this type is used for registered tags that can diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccTextDescriptionTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccTextDescriptionTagDataEntry.cs index 306ad2689f..71030c2a62 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccTextDescriptionTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccTextDescriptionTagDataEntry.cs @@ -4,7 +4,7 @@ using System; using System.Globalization; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// The TextDescriptionType contains three types of text description. diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccTextTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccTextTagDataEntry.cs index 772782619b..8127fae29e 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccTextTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccTextTagDataEntry.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// This is a simple text structure that contains a text string. diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUFix16ArrayTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUFix16ArrayTagDataEntry.cs index 77f8e1c87e..709106a52e 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUFix16ArrayTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUFix16ArrayTagDataEntry.cs @@ -4,7 +4,7 @@ using System; using System.Linq; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// This type represents an array of doubles (from 32bit values). diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt16ArrayTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt16ArrayTagDataEntry.cs index c42d5338ce..bcd991ceae 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt16ArrayTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt16ArrayTagDataEntry.cs @@ -4,7 +4,7 @@ using System; using System.Linq; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// This type represents an array of unsigned shorts. diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt32ArrayTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt32ArrayTagDataEntry.cs index d322d48a73..8a5ccb0c08 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt32ArrayTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt32ArrayTagDataEntry.cs @@ -4,7 +4,7 @@ using System; using System.Linq; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// This type represents an array of unsigned 32bit integers. diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt64ArrayTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt64ArrayTagDataEntry.cs index 5ff2b37b75..6e22f77585 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt64ArrayTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt64ArrayTagDataEntry.cs @@ -4,7 +4,7 @@ using System; using System.Linq; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// This type represents an array of unsigned 64bit integers. diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt8ArrayTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt8ArrayTagDataEntry.cs index 72f6dcc573..07e142d49e 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt8ArrayTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt8ArrayTagDataEntry.cs @@ -4,7 +4,7 @@ using System; using System.Linq; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// This type represents an array of bytes. diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUcrBgTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUcrBgTagDataEntry.cs index e189e9ae70..0f8bd6c33d 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUcrBgTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUcrBgTagDataEntry.cs @@ -4,7 +4,7 @@ using System; using System.Linq; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// This type contains curves representing the under color removal and black generation diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUnknownTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUnknownTagDataEntry.cs index 7628a2e14d..8b60aad266 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUnknownTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUnknownTagDataEntry.cs @@ -4,7 +4,7 @@ using System; using System.Linq; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// This tag stores data of an unknown tag data entry diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccViewingConditionsTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccViewingConditionsTagDataEntry.cs index 980f5b53bd..2c12066f1c 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccViewingConditionsTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccViewingConditionsTagDataEntry.cs @@ -4,7 +4,7 @@ using System; using System.Numerics; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// This type represents a set of viewing condition parameters. diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccXyzTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccXyzTagDataEntry.cs index 8b41cb5fba..d704fee969 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccXyzTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccXyzTagDataEntry.cs @@ -5,7 +5,7 @@ using System; using System.Linq; using System.Numerics; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// The XYZType contains an array of XYZ values. diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccClut.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccClut.cs index d9d8dc9ee7..af7e3e0114 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccClut.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccClut.cs @@ -4,7 +4,7 @@ using System; using System.Linq; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Color Lookup Table diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccColorantTableEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccColorantTableEntry.cs index b9b43e9b2a..17127110d6 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccColorantTableEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccColorantTableEntry.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Entry of ICC colorant table diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccLocalizedString.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccLocalizedString.cs index 6ffc51dbbd..68a5e7cfa1 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccLocalizedString.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccLocalizedString.cs @@ -4,7 +4,7 @@ using System; using System.Globalization; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// A string with a specific locale diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccLut.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccLut.cs index 3777a96eb3..12d3208a7b 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccLut.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccLut.cs @@ -4,7 +4,7 @@ using System; using System.Linq; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Lookup Table diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccNamedColor.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccNamedColor.cs index b59778caf4..98107e8281 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccNamedColor.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccNamedColor.cs @@ -4,7 +4,7 @@ using System; using System.Linq; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// A specific color with a name diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccPositionNumber.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccPositionNumber.cs index 9e58fd0281..6258ca2f36 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccPositionNumber.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccPositionNumber.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Position of an object within an ICC profile diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileDescription.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileDescription.cs index 2bb894d338..455717a030 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileDescription.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileDescription.cs @@ -4,7 +4,7 @@ using System; using System.Linq; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// ICC Profile description diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileId.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileId.cs index 955fd89eb0..1f96540df3 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileId.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileId.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// ICC Profile ID diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileSequenceIdentifier.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileSequenceIdentifier.cs index 7f5ab7d7fb..dfa3fb2037 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileSequenceIdentifier.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileSequenceIdentifier.cs @@ -4,7 +4,7 @@ using System; using System.Linq; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Description of a profile within a sequence diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccResponseNumber.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccResponseNumber.cs index 4607857c68..a10c55f4e4 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccResponseNumber.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccResponseNumber.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Associates a normalized device code with a measurement value diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccScreeningChannel.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccScreeningChannel.cs index dae6abb4da..f41858f303 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccScreeningChannel.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccScreeningChannel.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// A single channel of a diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccTagTableEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccTagTableEntry.cs index 4d900444fa..5464de9c5f 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccTagTableEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccTagTableEntry.cs @@ -3,7 +3,7 @@ using System; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.MetaData.Profiles.Icc { /// /// Entry of ICC tag table diff --git a/src/ImageSharp/PixelFormats/ComponentOrder.cs b/src/ImageSharp/PixelFormats/ComponentOrder.cs index d7d35726c8..868d082599 100644 --- a/src/ImageSharp/PixelFormats/ComponentOrder.cs +++ b/src/ImageSharp/PixelFormats/ComponentOrder.cs @@ -6,7 +6,7 @@ namespace SixLabors.ImageSharp.PixelFormats /// /// Enumerates the various component orders. /// - public enum ComponentOrder + internal enum ComponentOrder { /// /// Z-> Y-> X order. Equivalent to B-> G-> R in diff --git a/src/ImageSharp/PixelFormats/RgbaComponent.cs b/src/ImageSharp/PixelFormats/RgbaComponent.cs index edadd5818e..76df62c437 100644 --- a/src/ImageSharp/PixelFormats/RgbaComponent.cs +++ b/src/ImageSharp/PixelFormats/RgbaComponent.cs @@ -6,7 +6,7 @@ namespace SixLabors.ImageSharp /// /// Enumerates the RGBA (red, green, blue, alpha) color components. /// - public enum RgbaComponent + internal enum RgbaComponent { /// /// The red component. diff --git a/src/ImageSharp/Processing/Processors/Binarization/BinaryThresholdProcessor.cs b/src/ImageSharp/Processing/Processors/Binarization/BinaryThresholdProcessor.cs index 7070c993ef..5fffb89360 100644 --- a/src/ImageSharp/Processing/Processors/Binarization/BinaryThresholdProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Binarization/BinaryThresholdProcessor.cs @@ -84,7 +84,7 @@ namespace SixLabors.ImageSharp.Processing.Processors Parallel.For( minY, maxY, - this.ParallelOptions, + source.Configuration.ParallelOptions, y => { Span row = source.GetRowSpan(y - startY); diff --git a/src/ImageSharp/Processing/Processors/Binarization/ErrorDiffusionDitherProcessor.cs b/src/ImageSharp/Processing/Processors/Binarization/ErrorDiffusionDitherProcessor.cs index 2590aa6a00..ec92993a35 100644 --- a/src/ImageSharp/Processing/Processors/Binarization/ErrorDiffusionDitherProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Binarization/ErrorDiffusionDitherProcessor.cs @@ -61,39 +61,21 @@ namespace SixLabors.ImageSharp.Processing.Processors /// protected override void OnApply(ImageBase source, Rectangle sourceRectangle) { - int startY = sourceRectangle.Y; - int endY = sourceRectangle.Bottom; - int startX = sourceRectangle.X; - int endX = sourceRectangle.Right; + var interest = Rectangle.Intersect(sourceRectangle, source.Bounds()); + int startY = interest.Y; + int endY = interest.Bottom; + int startX = interest.X; + int endX = interest.Right; - // Align start/end positions. - int minX = Math.Max(0, startX); - int maxX = Math.Min(source.Width, endX); - int minY = Math.Max(0, startY); - int maxY = Math.Min(source.Height, endY); - - // Reset offset if necessary. - if (minX > 0) - { - startX = 0; - } - - if (minY > 0) - { - startY = 0; - } - - for (int y = minY; y < maxY; y++) + for (int y = startY; y < endY; y++) { - int offsetY = y - startY; - Span row = source.GetRowSpan(offsetY); + Span row = source.GetRowSpan(y); - for (int x = minX; x < maxX; x++) + for (int x = startX; x < endX; x++) { - int offsetX = x - startX; - TPixel sourceColor = row[offsetX]; + TPixel sourceColor = row[x]; TPixel transformedColor = sourceColor.ToVector4().X >= this.Threshold ? this.UpperColor : this.LowerColor; - this.Diffuser.Dither(source, sourceColor, transformedColor, offsetX, offsetY, maxX, maxY); + this.Diffuser.Dither(source, sourceColor, transformedColor, x, y, startX, startY, endX, endY); } } } diff --git a/src/ImageSharp/Processing/Processors/Binarization/OrderedDitherProcessor.cs b/src/ImageSharp/Processing/Processors/Binarization/OrderedDitherProcessor.cs index b71ea97cf7..27114be806 100644 --- a/src/ImageSharp/Processing/Processors/Binarization/OrderedDitherProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Binarization/OrderedDitherProcessor.cs @@ -69,39 +69,21 @@ namespace SixLabors.ImageSharp.Processing.Processors /// protected override void OnApply(ImageBase source, Rectangle sourceRectangle) { - int startY = sourceRectangle.Y; - int endY = sourceRectangle.Bottom; - int startX = sourceRectangle.X; - int endX = sourceRectangle.Right; - - // Align start/end positions. - int minX = Math.Max(0, startX); - int maxX = Math.Min(source.Width, endX); - int minY = Math.Max(0, startY); - int maxY = Math.Min(source.Height, endY); - - // Reset offset if necessary. - if (minX > 0) - { - startX = 0; - } - - if (minY > 0) - { - startY = 0; - } + var interest = Rectangle.Intersect(sourceRectangle, source.Bounds()); + int startY = interest.Y; + int endY = interest.Bottom; + int startX = interest.X; + int endX = interest.Right; byte[] bytes = new byte[4]; - for (int y = minY; y < maxY; y++) + for (int y = startY; y < endY; y++) { - int offsetY = y - startY; - Span row = source.GetRowSpan(offsetY); + Span row = source.GetRowSpan(y); - for (int x = minX; x < maxX; x++) + for (int x = startX; x < endX; x++) { - int offsetX = x - startX; - TPixel sourceColor = row[offsetX]; - this.Dither.Dither(source, sourceColor, this.UpperColor, this.LowerColor, bytes, this.Index, offsetX, offsetY, maxX, maxY); + TPixel sourceColor = row[x]; + this.Dither.Dither(source, sourceColor, this.UpperColor, this.LowerColor, bytes, this.Index, x, y); } } } diff --git a/src/ImageSharp/Processing/Processors/CloningImageProcessor.cs b/src/ImageSharp/Processing/Processors/CloningImageProcessor.cs index b4324a9ae3..a1fa3c9cba 100644 --- a/src/ImageSharp/Processing/Processors/CloningImageProcessor.cs +++ b/src/ImageSharp/Processing/Processors/CloningImageProcessor.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. using System; -using System.Threading.Tasks; + using SixLabors.ImageSharp.PixelFormats; using SixLabors.Primitives; @@ -12,23 +12,12 @@ namespace SixLabors.ImageSharp.Processing /// Allows the application of processors to images. /// /// The pixel format. - internal abstract class CloningImageProcessor : IImageProcessor, ICloningImageProcessor + internal abstract class CloningImageProcessor : ICloningImageProcessor where TPixel : struct, IPixel { - /// - public virtual ParallelOptions ParallelOptions { get; set; } - - /// - public virtual bool Compand { get; set; } = false; - /// public Image CloneAndApply(Image source, Rectangle sourceRectangle) { - if (this.ParallelOptions == null) - { - this.ParallelOptions = source.Configuration.ParallelOptions; - } - try { Image clone = this.CreateDestination(source, sourceRectangle); diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/BlackWhiteProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/BlackWhiteProcessor.cs index d8b6ab9514..9f81273433 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/BlackWhiteProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/BlackWhiteProcessor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/AchromatomalyProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/AchromatomalyProcessor.cs index 1366a8fe1b..91e5c7f68f 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/AchromatomalyProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/AchromatomalyProcessor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; @@ -15,7 +14,7 @@ namespace SixLabors.ImageSharp.Processing.Processors where TPixel : struct, IPixel { /// - public override Matrix4x4 Matrix => new Matrix4x4() + public override Matrix4x4 Matrix => new Matrix4x4 { M11 = .618F, M12 = .163F, diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/AchromatopsiaProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/AchromatopsiaProcessor.cs index d1925e04df..0d6578852c 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/AchromatopsiaProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/AchromatopsiaProcessor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; @@ -15,7 +14,7 @@ namespace SixLabors.ImageSharp.Processing.Processors where TPixel : struct, IPixel { /// - public override Matrix4x4 Matrix => new Matrix4x4() + public override Matrix4x4 Matrix => new Matrix4x4 { M11 = .299F, M12 = .299F, diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/DeuteranomalyProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/DeuteranomalyProcessor.cs index 964921d262..c4bb41ceb3 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/DeuteranomalyProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/DeuteranomalyProcessor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; @@ -15,7 +14,7 @@ namespace SixLabors.ImageSharp.Processing.Processors where TPixel : struct, IPixel { /// - public override Matrix4x4 Matrix => new Matrix4x4() + public override Matrix4x4 Matrix => new Matrix4x4 { M11 = 0.8F, M12 = 0.258F, diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/DeuteranopiaProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/DeuteranopiaProcessor.cs index f35d25a287..598af12ff0 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/DeuteranopiaProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/DeuteranopiaProcessor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; @@ -15,7 +14,7 @@ namespace SixLabors.ImageSharp.Processing.Processors where TPixel : struct, IPixel { /// - public override Matrix4x4 Matrix => new Matrix4x4() + public override Matrix4x4 Matrix => new Matrix4x4 { M11 = 0.625F, M12 = 0.7F, diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/ProtanomalyProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/ProtanomalyProcessor.cs index 4c43ad0e21..4e32cb5298 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/ProtanomalyProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/ProtanomalyProcessor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; @@ -15,7 +14,7 @@ namespace SixLabors.ImageSharp.Processing.Processors where TPixel : struct, IPixel { /// - public override Matrix4x4 Matrix => new Matrix4x4() + public override Matrix4x4 Matrix => new Matrix4x4 { M11 = 0.817F, M12 = 0.333F, diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/ProtanopiaProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/ProtanopiaProcessor.cs index 3a18ed91e2..d49b4a2cc0 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/ProtanopiaProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/ProtanopiaProcessor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; @@ -15,7 +14,7 @@ namespace SixLabors.ImageSharp.Processing.Processors where TPixel : struct, IPixel { /// - public override Matrix4x4 Matrix => new Matrix4x4() + public override Matrix4x4 Matrix => new Matrix4x4 { M11 = 0.567F, M12 = 0.558F, diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/TritanomalyProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/TritanomalyProcessor.cs index 0c337af2d0..d34f22343c 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/TritanomalyProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/TritanomalyProcessor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; @@ -15,7 +14,7 @@ namespace SixLabors.ImageSharp.Processing.Processors where TPixel : struct, IPixel { /// - public override Matrix4x4 Matrix => new Matrix4x4() + public override Matrix4x4 Matrix => new Matrix4x4 { M11 = 0.967F, M21 = 0.33F, diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/TritanopiaProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/TritanopiaProcessor.cs index 76c9f98e74..453ac99a72 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/TritanopiaProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/TritanopiaProcessor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; @@ -15,7 +14,7 @@ namespace SixLabors.ImageSharp.Processing.Processors where TPixel : struct, IPixel { /// - public override Matrix4x4 Matrix => new Matrix4x4() + public override Matrix4x4 Matrix => new Matrix4x4 { M11 = 0.95F, M21 = 0.05F, diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorMatrixProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorMatrixProcessor.cs index 45ee1de59e..e93305cca1 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorMatrixProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorMatrixProcessor.cs @@ -13,14 +13,14 @@ namespace SixLabors.ImageSharp.Processing.Processors /// The color matrix filter. Inherit from this class to perform operation involving color matrices. /// /// The pixel format. - internal abstract class ColorMatrixProcessor : ImageProcessor, IColorMatrixFilter + internal abstract class ColorMatrixProcessor : ImageProcessor, IColorMatrixProcessor where TPixel : struct, IPixel { /// public abstract Matrix4x4 Matrix { get; } /// - public override bool Compand { get; set; } = true; + public virtual bool Compand { get; set; } = true; /// protected override void OnApply(ImageBase source, Rectangle sourceRectangle) @@ -50,31 +50,28 @@ namespace SixLabors.ImageSharp.Processing.Processors Matrix4x4 matrix = this.Matrix; bool compand = this.Compand; - using (PixelAccessor sourcePixels = source.Lock()) - { - Parallel.For( - minY, - maxY, - this.ParallelOptions, - y => - { - Span row = source.GetRowSpan(y - startY); + Parallel.For( + minY, + maxY, + source.Configuration.ParallelOptions, + y => + { + Span row = source.GetRowSpan(y - startY); - for (int x = minX; x < maxX; x++) - { - ref TPixel pixel = ref row[x - startX]; - var vector = pixel.ToVector4(); + for (int x = minX; x < maxX; x++) + { + ref TPixel pixel = ref row[x - startX]; + var vector = pixel.ToVector4(); - if (compand) - { - vector = vector.Expand(); - } + if (compand) + { + vector = vector.Expand(); + } - vector = Vector4.Transform(vector, matrix); - pixel.PackFromVector4(compand ? vector.Compress() : vector); - } - }); - } + vector = Vector4.Transform(vector, matrix); + pixel.PackFromVector4(compand ? vector.Compress() : vector); + } + }); } } } \ No newline at end of file diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/GrayscaleBt601Processor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/GrayscaleBt601Processor.cs index a7033cfc95..35dfe41a82 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/GrayscaleBt601Processor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/GrayscaleBt601Processor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; @@ -16,7 +15,7 @@ namespace SixLabors.ImageSharp.Processing.Processors where TPixel : struct, IPixel { /// - public override Matrix4x4 Matrix => new Matrix4x4() + public override Matrix4x4 Matrix => new Matrix4x4 { M11 = .299F, M12 = .299F, diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/GrayscaleBt709Processor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/GrayscaleBt709Processor.cs index db7077620a..6bb460ee67 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/GrayscaleBt709Processor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/GrayscaleBt709Processor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; @@ -16,7 +15,7 @@ namespace SixLabors.ImageSharp.Processing.Processors where TPixel : struct, IPixel { /// - public override Matrix4x4 Matrix => new Matrix4x4() + public override Matrix4x4 Matrix => new Matrix4x4 { M11 = .2126F, M12 = .2126F, diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/HueProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/HueProcessor.cs index a222f195e9..9a40bfca89 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/HueProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/HueProcessor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; @@ -46,7 +45,7 @@ namespace SixLabors.ImageSharp.Processing.Processors // The matrix is set up to preserve the luminance of the image. // See http://graficaobscura.com/matrix/index.html // Number are taken from https://msdn.microsoft.com/en-us/library/jj192162(v=vs.85).aspx - Matrix4x4 matrix4X4 = new Matrix4x4() + var matrix4X4 = new Matrix4x4 { M11 = lumR + (cosradians * oneMinusLumR) - (sinradians * lumR), M12 = lumR - (cosradians * lumR) - (sinradians * 0.143F), diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/IColorMatrixFilter.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/IColorMatrixProcessor.cs similarity index 70% rename from src/ImageSharp/Processing/Processors/ColorMatrix/IColorMatrixFilter.cs rename to src/ImageSharp/Processing/Processors/ColorMatrix/IColorMatrixProcessor.cs index d7785045fb..84e7461b56 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/IColorMatrixFilter.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/IColorMatrixProcessor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; @@ -12,12 +11,17 @@ namespace SixLabors.ImageSharp.Processing.Processors /// alter the image pixels. /// /// The pixel format. - internal interface IColorMatrixFilter : IImageProcessor + internal interface IColorMatrixProcessor : IImageProcessor where TPixel : struct, IPixel { /// /// Gets the used to alter the image. /// Matrix4x4 Matrix { get; } + + /// + /// Gets or sets a value indicating whether to compress or expand individual pixel color values on processing. + /// + bool Compand { get; set; } } } diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/KodachromeProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/KodachromeProcessor.cs index e2ab32a70a..4277e1fc2e 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/KodachromeProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/KodachromeProcessor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; @@ -15,7 +14,7 @@ namespace SixLabors.ImageSharp.Processing.Processors where TPixel : struct, IPixel { /// - public override Matrix4x4 Matrix => new Matrix4x4() + public override Matrix4x4 Matrix => new Matrix4x4 { M11 = 0.6997023F, M22 = 0.4609577F, diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/LomographProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/LomographProcessor.cs index 7ce96fa355..dcb5955c00 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/LomographProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/LomographProcessor.cs @@ -1,7 +1,6 @@ // 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.Primitives; @@ -16,7 +15,7 @@ namespace SixLabors.ImageSharp.Processing.Processors where TPixel : struct, IPixel { private static readonly TPixel VeryDarkGreen = ColorBuilder.FromRGBA(0, 10, 0, 255); - private GraphicsOptions options; + private readonly GraphicsOptions options; /// /// Initializes a new instance of the class. @@ -28,7 +27,7 @@ namespace SixLabors.ImageSharp.Processing.Processors } /// - public override Matrix4x4 Matrix => new Matrix4x4() + public override Matrix4x4 Matrix => new Matrix4x4 { M11 = 1.5F, M22 = 1.45F, diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/PolaroidProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/PolaroidProcessor.cs index 96fb084cfd..928a641a00 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/PolaroidProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/PolaroidProcessor.cs @@ -1,7 +1,6 @@ // 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.Primitives; @@ -15,9 +14,9 @@ namespace SixLabors.ImageSharp.Processing.Processors internal class PolaroidProcessor : ColorMatrixProcessor where TPixel : struct, IPixel { - private static TPixel veryDarkOrange = ColorBuilder.FromRGB(102, 34, 0); - private static TPixel lightOrange = ColorBuilder.FromRGBA(255, 153, 102, 178); - private GraphicsOptions options; + private static readonly TPixel VeryDarkOrange = ColorBuilder.FromRGB(102, 34, 0); + private static readonly TPixel LightOrange = ColorBuilder.FromRGBA(255, 153, 102, 178); + private readonly GraphicsOptions options; /// /// Initializes a new instance of the class. @@ -29,7 +28,7 @@ namespace SixLabors.ImageSharp.Processing.Processors } /// - public override Matrix4x4 Matrix => new Matrix4x4() + public override Matrix4x4 Matrix => new Matrix4x4 { M11 = 1.538F, M12 = -0.062F, @@ -49,8 +48,8 @@ namespace SixLabors.ImageSharp.Processing.Processors /// protected override void AfterApply(ImageBase source, Rectangle sourceRectangle) { - new VignetteProcessor(veryDarkOrange, this.options).Apply(source, sourceRectangle); - new GlowProcessor(lightOrange, source.Width / 4F, this.options).Apply(source, sourceRectangle); + new VignetteProcessor(VeryDarkOrange, this.options).Apply(source, sourceRectangle); + new GlowProcessor(LightOrange, source.Width / 4F, this.options).Apply(source, sourceRectangle); } } } \ No newline at end of file diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/SaturationProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/SaturationProcessor.cs index 38788d9f9e..1f01bc85dc 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/SaturationProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/SaturationProcessor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; @@ -39,7 +38,7 @@ namespace SixLabors.ImageSharp.Processing.Processors float saturationComplementG = 0.6094f * saturationComplement; float saturationComplementB = 0.0820f * saturationComplement; - Matrix4x4 matrix4X4 = new Matrix4x4 + var matrix4X4 = new Matrix4x4 { M11 = saturationComplementR + saturationFactor, M12 = saturationComplementR, diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/SepiaProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/SepiaProcessor.cs index 610b3d5f1c..d959ebf521 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/SepiaProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/SepiaProcessor.cs @@ -1,7 +1,6 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using System.Numerics; using SixLabors.ImageSharp.PixelFormats; diff --git a/src/ImageSharp/Processing/Processors/Convolution/Convolution2DProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/Convolution2DProcessor.cs index 1fe31be448..b13117a585 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/Convolution2DProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/Convolution2DProcessor.cs @@ -62,7 +62,7 @@ namespace SixLabors.ImageSharp.Processing.Processors Parallel.For( startY, endY, - this.ParallelOptions, + source.Configuration.ParallelOptions, y => { Span sourceRow = source.GetRowSpan(y); diff --git a/src/ImageSharp/Processing/Processors/Convolution/Convolution2PassProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/Convolution2PassProcessor.cs index 16b8075fcf..08ea5a6412 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/Convolution2PassProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/Convolution2PassProcessor.cs @@ -43,12 +43,13 @@ namespace SixLabors.ImageSharp.Processing.Processors { int width = source.Width; int height = source.Height; + ParallelOptions parallelOptions = source.Configuration.ParallelOptions; using (var firstPassPixels = new PixelAccessor(width, height)) using (PixelAccessor sourcePixels = source.Lock()) { - this.ApplyConvolution(firstPassPixels, sourcePixels, source.Bounds(), this.KernelX); - this.ApplyConvolution(sourcePixels, firstPassPixels, sourceRectangle, this.KernelY); + this.ApplyConvolution(firstPassPixels, sourcePixels, source.Bounds(), this.KernelX, parallelOptions); + this.ApplyConvolution(sourcePixels, firstPassPixels, sourceRectangle, this.KernelY, parallelOptions); } } @@ -62,7 +63,13 @@ namespace SixLabors.ImageSharp.Processing.Processors /// The structure that specifies the portion of the image object to draw. /// /// The kernel operator. - private void ApplyConvolution(PixelAccessor targetPixels, PixelAccessor sourcePixels, Rectangle sourceRectangle, Fast2DArray kernel) + /// The parellel options + private void ApplyConvolution( + PixelAccessor targetPixels, + PixelAccessor sourcePixels, + Rectangle sourceRectangle, + Fast2DArray kernel, + ParallelOptions parallelOptions) { int kernelHeight = kernel.Height; int kernelWidth = kernel.Width; @@ -79,7 +86,7 @@ namespace SixLabors.ImageSharp.Processing.Processors Parallel.For( startY, endY, - this.ParallelOptions, + parallelOptions, y => { Span targetRow = targetPixels.GetRowSpan(y); diff --git a/src/ImageSharp/Processing/Processors/Convolution/ConvolutionProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/ConvolutionProcessor.cs index 9e256975e3..9ffc04f055 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/ConvolutionProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/ConvolutionProcessor.cs @@ -51,7 +51,7 @@ namespace SixLabors.ImageSharp.Processing.Processors Parallel.For( startY, endY, - this.ParallelOptions, + source.Configuration.ParallelOptions, y => { Span sourceRow = source.GetRowSpan(y); diff --git a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/EdgeDetectorCompassProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/EdgeDetectorCompassProcessor.cs index 38bffe0c3c..aa3c605355 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/EdgeDetectorCompassProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/EdgeDetectorCompassProcessor.cs @@ -123,7 +123,7 @@ namespace SixLabors.ImageSharp.Processing.Processors Parallel.For( minY, maxY, - this.ParallelOptions, + source.Configuration.ParallelOptions, y => { int offsetY = y - shiftY; diff --git a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/IEdgeDetectorProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/IEdgeDetectorProcessor.cs index 1561072c82..6208a24a46 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/IEdgeDetectorProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/IEdgeDetectorProcessor.cs @@ -4,7 +4,7 @@ using System; using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Processors +namespace SixLabors.ImageSharp.Processing { /// /// Provides properties and methods allowing the detection of edges within an image. diff --git a/src/ImageSharp/Processing/Processors/Effects/AlphaProcessor.cs b/src/ImageSharp/Processing/Processors/Effects/AlphaProcessor.cs index ce0998a3c1..97c0b6745d 100644 --- a/src/ImageSharp/Processing/Processors/Effects/AlphaProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Effects/AlphaProcessor.cs @@ -64,7 +64,7 @@ namespace SixLabors.ImageSharp.Processing.Processors Parallel.For( minY, maxY, - this.ParallelOptions, + source.Configuration.ParallelOptions, y => { Span row = source.GetRowSpan(y - startY); diff --git a/src/ImageSharp/Processing/Processors/Effects/BackgroundColorProcessor.cs b/src/ImageSharp/Processing/Processors/Effects/BackgroundColorProcessor.cs index 21cc22bc9c..d97d4534dc 100644 --- a/src/ImageSharp/Processing/Processors/Effects/BackgroundColorProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Effects/BackgroundColorProcessor.cs @@ -79,7 +79,7 @@ namespace SixLabors.ImageSharp.Processing.Processors Parallel.For( minY, maxY, - this.ParallelOptions, + source.Configuration.ParallelOptions, y => { Span destination = source.GetRowSpan(y - startY).Slice(minX - startX, width); diff --git a/src/ImageSharp/Processing/Processors/Effects/BrightnessProcessor.cs b/src/ImageSharp/Processing/Processors/Effects/BrightnessProcessor.cs index 096f6b7abd..0aad1ef532 100644 --- a/src/ImageSharp/Processing/Processors/Effects/BrightnessProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Effects/BrightnessProcessor.cs @@ -64,7 +64,7 @@ namespace SixLabors.ImageSharp.Processing.Processors Parallel.For( minY, maxY, - this.ParallelOptions, + source.Configuration.ParallelOptions, y => { Span row = source.GetRowSpan(y - startY); diff --git a/src/ImageSharp/Processing/Processors/Effects/ContrastProcessor.cs b/src/ImageSharp/Processing/Processors/Effects/ContrastProcessor.cs index ba4c8b4dcb..97159c8730 100644 --- a/src/ImageSharp/Processing/Processors/Effects/ContrastProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Effects/ContrastProcessor.cs @@ -66,7 +66,7 @@ namespace SixLabors.ImageSharp.Processing.Processors Parallel.For( minY, maxY, - this.ParallelOptions, + source.Configuration.ParallelOptions, y => { Span row = source.GetRowSpan(y - startY); diff --git a/src/ImageSharp/Processing/Processors/Effects/InvertProcessor.cs b/src/ImageSharp/Processing/Processors/Effects/InvertProcessor.cs index 683433e28e..12692f2bd8 100644 --- a/src/ImageSharp/Processing/Processors/Effects/InvertProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Effects/InvertProcessor.cs @@ -45,7 +45,7 @@ namespace SixLabors.ImageSharp.Processing.Processors Parallel.For( minY, maxY, - this.ParallelOptions, + source.Configuration.ParallelOptions, y => { Span row = source.GetRowSpan(y - startY); diff --git a/src/ImageSharp/Processing/Processors/Effects/OilPaintingProcessor.cs b/src/ImageSharp/Processing/Processors/Effects/OilPaintingProcessor.cs index 35b2bd2536..21c13634be 100644 --- a/src/ImageSharp/Processing/Processors/Effects/OilPaintingProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Effects/OilPaintingProcessor.cs @@ -71,7 +71,7 @@ namespace SixLabors.ImageSharp.Processing.Processors Parallel.For( startY, maxY, - this.ParallelOptions, + source.Configuration.ParallelOptions, y => { Span sourceRow = source.GetRowSpan(y); diff --git a/src/ImageSharp/Processing/Processors/Effects/PixelateProcessor.cs b/src/ImageSharp/Processing/Processors/Effects/PixelateProcessor.cs index 7050e5eeb7..ce10915f29 100644 --- a/src/ImageSharp/Processing/Processors/Effects/PixelateProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Effects/PixelateProcessor.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; +using SixLabors.ImageSharp.Common; using SixLabors.ImageSharp.PixelFormats; using SixLabors.Primitives; @@ -71,7 +72,7 @@ namespace SixLabors.ImageSharp.Processing.Processors Parallel.ForEach( range, - this.ParallelOptions, + source.Configuration.ParallelOptions, y => { int offsetY = y - startY; diff --git a/src/ImageSharp/Processing/Processors/ImageProcessor.cs b/src/ImageSharp/Processing/Processors/ImageProcessor.cs index 84ad7f8993..1a4d52d3ed 100644 --- a/src/ImageSharp/Processing/Processors/ImageProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ImageProcessor.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. using System; -using System.Threading.Tasks; + using SixLabors.ImageSharp.PixelFormats; using SixLabors.Primitives; @@ -15,20 +15,9 @@ namespace SixLabors.ImageSharp.Processing internal abstract class ImageProcessor : IImageProcessor where TPixel : struct, IPixel { - /// - public virtual ParallelOptions ParallelOptions { get; set; } - - /// - public virtual bool Compand { get; set; } = false; - /// public void Apply(Image source, Rectangle sourceRectangle) { - if (this.ParallelOptions == null) - { - this.ParallelOptions = source.Configuration.ParallelOptions; - } - try { this.BeforeImageApply(source, sourceRectangle); @@ -66,11 +55,6 @@ namespace SixLabors.ImageSharp.Processing /// the target public void Apply(ImageBase source, Rectangle sourceRectangle) { - if (this.ParallelOptions == null) - { - this.ParallelOptions = source.Configuration.ParallelOptions; - } - try { this.BeforeApply(source, sourceRectangle); diff --git a/src/ImageSharp/Processing/Processors/Overlays/GlowProcessor.cs b/src/ImageSharp/Processing/Processors/Overlays/GlowProcessor.cs index 99300eb964..725ad9eca3 100644 --- a/src/ImageSharp/Processing/Processors/Overlays/GlowProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Overlays/GlowProcessor.cs @@ -91,7 +91,7 @@ namespace SixLabors.ImageSharp.Processing.Processors Parallel.For( minY, maxY, - this.ParallelOptions, + source.Configuration.ParallelOptions, y => { using (var amounts = new Buffer(width)) diff --git a/src/ImageSharp/Processing/Processors/Overlays/VignetteProcessor.cs b/src/ImageSharp/Processing/Processors/Overlays/VignetteProcessor.cs index 58e579509a..4d9df46d81 100644 --- a/src/ImageSharp/Processing/Processors/Overlays/VignetteProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Overlays/VignetteProcessor.cs @@ -112,7 +112,7 @@ namespace SixLabors.ImageSharp.Processing.Processors Parallel.For( minY, maxY, - this.ParallelOptions, + source.Configuration.ParallelOptions, y => { using (var amounts = new Buffer(width)) diff --git a/src/ImageSharp/Processing/Processors/Transforms/AutoRotateProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/AutoRotateProcessor.cs index e568bdea83..76271529d7 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/AutoRotateProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/AutoRotateProcessor.cs @@ -4,6 +4,7 @@ using System; using System.Threading.Tasks; using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.MetaData.Profiles.Exif; using SixLabors.ImageSharp.PixelFormats; using SixLabors.Primitives; diff --git a/src/ImageSharp/Processing/Processors/Transforms/CropProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/CropProcessor.cs index d68c289db1..b4c4ca594b 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/CropProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/CropProcessor.cs @@ -48,7 +48,7 @@ namespace SixLabors.ImageSharp.Processing.Processors Parallel.For( minY, maxY, - this.ParallelOptions, + source.Configuration.ParallelOptions, y => { Span sourceRow = source.GetRowSpan(minX, y); diff --git a/src/ImageSharp/Processing/Processors/Transforms/FlipProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/FlipProcessor.cs index f0173a6666..ba64392928 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/FlipProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/FlipProcessor.cs @@ -61,7 +61,7 @@ namespace SixLabors.ImageSharp.Processing.Processors Parallel.For( 0, halfHeight, - this.ParallelOptions, + source.Configuration.ParallelOptions, y => { int newY = height - y - 1; @@ -94,7 +94,7 @@ namespace SixLabors.ImageSharp.Processing.Processors Parallel.For( 0, height, - this.ParallelOptions, + source.Configuration.ParallelOptions, y => { Span sourceRow = source.GetRowSpan(y); diff --git a/src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs index 592e8d2e34..4560da6e75 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs @@ -42,6 +42,11 @@ namespace SixLabors.ImageSharp.Processing.Processors { } + /// + /// Gets or sets a value indicating whether to compress or expand individual pixel color values on processing. + /// + public bool Compand { get; set; } + /// protected override Image CreateDestination(Image source, Rectangle sourceRectangle) { @@ -95,7 +100,7 @@ namespace SixLabors.ImageSharp.Processing.Processors Parallel.For( minY, maxY, - this.ParallelOptions, + source.Configuration.ParallelOptions, y => { // Y coordinates of source points @@ -124,7 +129,7 @@ namespace SixLabors.ImageSharp.Processing.Processors Parallel.For( 0, sourceRectangle.Bottom, - this.ParallelOptions, + source.Configuration.ParallelOptions, y => { // TODO: Without Parallel.For() this buffer object could be reused: @@ -157,7 +162,7 @@ namespace SixLabors.ImageSharp.Processing.Processors Parallel.For( minY, maxY, - this.ParallelOptions, + source.Configuration.ParallelOptions, y => { // Ensure offsets are normalised for cropping and padding. diff --git a/src/ImageSharp/Processing/Processors/Transforms/RotateProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/RotateProcessor.cs index b8341d4027..6e76834b91 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/RotateProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/RotateProcessor.cs @@ -50,7 +50,7 @@ namespace SixLabors.ImageSharp.Processing.Processors Parallel.For( 0, height, - this.ParallelOptions, + source.Configuration.ParallelOptions, y => { Span targetRow = targetPixels.GetRowSpan(y); @@ -135,7 +135,7 @@ namespace SixLabors.ImageSharp.Processing.Processors Parallel.For( 0, height, - this.ParallelOptions, + source.Configuration.ParallelOptions, y => { for (int x = 0; x < width; x++) @@ -166,7 +166,7 @@ namespace SixLabors.ImageSharp.Processing.Processors Parallel.For( 0, height, - this.ParallelOptions, + source.Configuration.ParallelOptions, y => { Span sourceRow = source.GetRowSpan(y); @@ -196,7 +196,7 @@ namespace SixLabors.ImageSharp.Processing.Processors Parallel.For( 0, height, - this.ParallelOptions, + source.Configuration.ParallelOptions, y => { Span sourceRow = source.GetRowSpan(y); diff --git a/src/ImageSharp/Processing/Processors/Transforms/SkewProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/SkewProcessor.cs index bd84e483f5..85bf1b6938 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/SkewProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/SkewProcessor.cs @@ -50,7 +50,7 @@ namespace SixLabors.ImageSharp.Processing.Processors Parallel.For( 0, height, - this.ParallelOptions, + source.Configuration.ParallelOptions, y => { Span targetRow = targetPixels.GetRowSpan(y); diff --git a/src/ImageSharp/Quantizers/OctreeQuantizer{TPixel}.cs b/src/ImageSharp/Quantizers/OctreeQuantizer{TPixel}.cs index f41bcd04de..dc65442bbc 100644 --- a/src/ImageSharp/Quantizers/OctreeQuantizer{TPixel}.cs +++ b/src/ImageSharp/Quantizers/OctreeQuantizer{TPixel}.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Runtime.CompilerServices; using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Quantizers.Base; namespace SixLabors.ImageSharp.Quantizers { @@ -13,7 +14,7 @@ namespace SixLabors.ImageSharp.Quantizers /// /// /// The pixel format. - public sealed class OctreeQuantizer : Quantizer + public sealed class OctreeQuantizer : QuantizerBase where TPixel : struct, IPixel { /// @@ -103,7 +104,7 @@ namespace SixLabors.ImageSharp.Quantizers if (this.Dither) { // Apply the dithering matrix. We have to reapply the value now as the original has changed. - this.DitherType.Dither(source, sourcePixel, transformedPixel, x, y, width, height, false); + this.DitherType.Dither(source, sourcePixel, transformedPixel, x, y, 0, 0, width, height, false); } output[(y * source.Width) + x] = pixelValue; diff --git a/src/ImageSharp/Quantizers/PaletteQuantizer{TPixel}.cs b/src/ImageSharp/Quantizers/PaletteQuantizer{TPixel}.cs index 56ecf7c900..b03e690e4d 100644 --- a/src/ImageSharp/Quantizers/PaletteQuantizer{TPixel}.cs +++ b/src/ImageSharp/Quantizers/PaletteQuantizer{TPixel}.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Runtime.CompilerServices; using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Quantizers.Base; namespace SixLabors.ImageSharp.Quantizers { @@ -13,7 +14,7 @@ namespace SixLabors.ImageSharp.Quantizers /// /// /// The pixel format. - public sealed class PaletteQuantizer : Quantizer + public sealed class PaletteQuantizer : QuantizerBase where TPixel : struct, IPixel { /// @@ -99,7 +100,7 @@ namespace SixLabors.ImageSharp.Quantizers if (this.Dither) { // Apply the dithering matrix. We have to reapply the value now as the original has changed. - this.DitherType.Dither(source, sourcePixel, transformedPixel, x, y, width, height, false); + this.DitherType.Dither(source, sourcePixel, transformedPixel, x, y, 0, 0, width, height, false); } output[(y * source.Width) + x] = pixelValue; diff --git a/src/ImageSharp/Quantizers/Quantizer{TPixel}.cs b/src/ImageSharp/Quantizers/QuantizerBase{TPixel}.cs similarity index 96% rename from src/ImageSharp/Quantizers/Quantizer{TPixel}.cs rename to src/ImageSharp/Quantizers/QuantizerBase{TPixel}.cs index c658917755..2bd7267921 100644 --- a/src/ImageSharp/Quantizers/Quantizer{TPixel}.cs +++ b/src/ImageSharp/Quantizers/QuantizerBase{TPixel}.cs @@ -8,13 +8,13 @@ using System.Runtime.CompilerServices; using SixLabors.ImageSharp.Dithering; using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Quantizers +namespace SixLabors.ImageSharp.Quantizers.Base { /// /// Encapsulates methods to calculate the color palette of an image. /// /// The pixel format. - public abstract class Quantizer : IQuantizer + public abstract class QuantizerBase : IQuantizer where TPixel : struct, IPixel { /// @@ -23,7 +23,7 @@ namespace SixLabors.ImageSharp.Quantizers private readonly bool singlePass; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// If true, the quantization only needs to loop through the source pixels once @@ -33,7 +33,7 @@ namespace SixLabors.ImageSharp.Quantizers /// only call the 'QuantizeImage' function. If two passes are required, the code will call 'InitialQuantizeImage' /// and then 'QuantizeImage'. /// - protected Quantizer(bool singlePass) + protected QuantizerBase(bool singlePass) { this.singlePass = singlePass; } @@ -42,7 +42,7 @@ namespace SixLabors.ImageSharp.Quantizers public bool Dither { get; set; } = true; /// - public IErrorDiffuser DitherType { get; set; } = new SierraLite(); + public IErrorDiffuser DitherType { get; set; } = new SierraLiteDiffuser(); /// public virtual QuantizedImage Quantize(ImageBase image, int maxColors) diff --git a/src/ImageSharp/Quantizers/WuQuantizer{TPixel}.cs b/src/ImageSharp/Quantizers/WuQuantizer{TPixel}.cs index 4bb9028176..79319cfbd7 100644 --- a/src/ImageSharp/Quantizers/WuQuantizer{TPixel}.cs +++ b/src/ImageSharp/Quantizers/WuQuantizer{TPixel}.cs @@ -7,6 +7,7 @@ using System.Collections.Generic; using System.Numerics; using System.Runtime.CompilerServices; using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Quantizers.Base; namespace SixLabors.ImageSharp.Quantizers { @@ -30,7 +31,7 @@ namespace SixLabors.ImageSharp.Quantizers /// /// /// The pixel format. - public class WuQuantizer : Quantizer + public class WuQuantizer : QuantizerBase where TPixel : struct, IPixel { /// @@ -277,7 +278,7 @@ namespace SixLabors.ImageSharp.Quantizers if (this.Dither) { // Apply the dithering matrix. We have to reapply the value now as the original has changed. - this.DitherType.Dither(source, sourcePixel, transformedPixel, x, y, width, height, false); + this.DitherType.Dither(source, sourcePixel, transformedPixel, x, y, 0, 0, width, height, false); } output[(y * source.Width) + x] = pixelValue; diff --git a/tests/ImageSharp.Benchmarks/Image/DecodeJpegMultiple.cs b/tests/ImageSharp.Benchmarks/Image/DecodeJpegMultiple.cs index a4d9ea05bd..102861a459 100644 --- a/tests/ImageSharp.Benchmarks/Image/DecodeJpegMultiple.cs +++ b/tests/ImageSharp.Benchmarks/Image/DecodeJpegMultiple.cs @@ -13,7 +13,7 @@ namespace SixLabors.ImageSharp.Benchmarks.Image using ImageSharp.Formats; using ImageSharp.Formats.Jpeg.GolangPort; using ImageSharp.PixelFormats; - + using SixLabors.ImageSharp.Formats.Jpeg; using CoreImage = ImageSharp.Image; [Config(typeof(Config.Short))] diff --git a/tests/ImageSharp.Benchmarks/Image/EncodeBmpMultiple.cs b/tests/ImageSharp.Benchmarks/Image/EncodeBmpMultiple.cs index 791e812ffc..e83712ffc7 100644 --- a/tests/ImageSharp.Benchmarks/Image/EncodeBmpMultiple.cs +++ b/tests/ImageSharp.Benchmarks/Image/EncodeBmpMultiple.cs @@ -11,6 +11,7 @@ namespace SixLabors.ImageSharp.Benchmarks.Image using BenchmarkDotNet.Attributes; using SixLabors.ImageSharp.Formats; + using SixLabors.ImageSharp.Formats.Bmp; [Config(typeof(Config.Short))] public class EncodeBmpMultiple : MultiImageBenchmarkBase.WithImagesPreloaded diff --git a/tests/ImageSharp.Benchmarks/Image/EncodeGifMultiple.cs b/tests/ImageSharp.Benchmarks/Image/EncodeGifMultiple.cs index 244ff58828..571299812c 100644 --- a/tests/ImageSharp.Benchmarks/Image/EncodeGifMultiple.cs +++ b/tests/ImageSharp.Benchmarks/Image/EncodeGifMultiple.cs @@ -7,6 +7,7 @@ using BenchmarkDotNet.Jobs; using SixLabors.ImageSharp.Formats; + using SixLabors.ImageSharp.Formats.Gif; [Config(typeof(SingleRunConfig))] public class EncodeGifMultiple : MultiImageBenchmarkBase.WithImagesPreloaded diff --git a/tests/ImageSharp.Benchmarks/Image/EncodeIndexedPng.cs b/tests/ImageSharp.Benchmarks/Image/EncodeIndexedPng.cs index 7c48dbae28..70ea164d69 100644 --- a/tests/ImageSharp.Benchmarks/Image/EncodeIndexedPng.cs +++ b/tests/ImageSharp.Benchmarks/Image/EncodeIndexedPng.cs @@ -11,6 +11,7 @@ namespace SixLabors.ImageSharp.Benchmarks.Image using SixLabors.ImageSharp; using SixLabors.ImageSharp.Formats; + using SixLabors.ImageSharp.Formats.Png; using SixLabors.ImageSharp.Quantizers; using CoreImage = ImageSharp.Image; diff --git a/tests/ImageSharp.Benchmarks/Image/EncodeJpegMultiple.cs b/tests/ImageSharp.Benchmarks/Image/EncodeJpegMultiple.cs index 38b97f0043..efd69d329f 100644 --- a/tests/ImageSharp.Benchmarks/Image/EncodeJpegMultiple.cs +++ b/tests/ImageSharp.Benchmarks/Image/EncodeJpegMultiple.cs @@ -11,8 +11,8 @@ namespace SixLabors.ImageSharp.Benchmarks.Image using BenchmarkDotNet.Attributes; using SixLabors.ImageSharp.Formats; + using SixLabors.ImageSharp.Formats.Jpeg; - [Config(typeof(Config.Short))] // It's long enough to iterate through multiple files public class EncodeJpegMultiple : MultiImageBenchmarkBase.WithImagesPreloaded { diff --git a/tests/ImageSharp.Benchmarks/Image/EncodePng.cs b/tests/ImageSharp.Benchmarks/Image/EncodePng.cs index 0401132fca..8c9fcbbb31 100644 --- a/tests/ImageSharp.Benchmarks/Image/EncodePng.cs +++ b/tests/ImageSharp.Benchmarks/Image/EncodePng.cs @@ -12,8 +12,9 @@ namespace SixLabors.ImageSharp.Benchmarks.Image using BenchmarkDotNet.Attributes; using SixLabors.ImageSharp.Formats; + using SixLabors.ImageSharp.Formats.Png; using SixLabors.ImageSharp.Quantizers; - + using SixLabors.ImageSharp.Quantizers.Base; using CoreImage = ImageSharp.Image; public class EncodePng : BenchmarkBase @@ -66,8 +67,8 @@ namespace SixLabors.ImageSharp.Benchmarks.Image { using (MemoryStream memoryStream = new MemoryStream()) { - Quantizer quantizer = this.UseOctreeQuantizer - ? (Quantizer) + QuantizerBase quantizer = this.UseOctreeQuantizer + ? (QuantizerBase) new OctreeQuantizer() : new PaletteQuantizer(); diff --git a/tests/ImageSharp.Benchmarks/Samplers/Glow.cs b/tests/ImageSharp.Benchmarks/Samplers/Glow.cs index b6dd7f4e76..1530905c7e 100644 --- a/tests/ImageSharp.Benchmarks/Samplers/Glow.cs +++ b/tests/ImageSharp.Benchmarks/Samplers/Glow.cs @@ -112,7 +112,7 @@ namespace SixLabors.ImageSharp.Benchmarks Parallel.For( minY, maxY, - this.ParallelOptions, + source.Configuration.ParallelOptions, y => { int offsetY = y - startY; diff --git a/tests/ImageSharp.Tests/Colorspaces/ColorSpaceEqualityTests.cs b/tests/ImageSharp.Tests/Colorspaces/ColorSpaceEqualityTests.cs index 7fdebcac49..ee6336c977 100644 --- a/tests/ImageSharp.Tests/Colorspaces/ColorSpaceEqualityTests.cs +++ b/tests/ImageSharp.Tests/Colorspaces/ColorSpaceEqualityTests.cs @@ -2,6 +2,8 @@ // Licensed under the Apache License, Version 2.0. using System; +using System.Collections.Generic; +using System.Linq; using System.Numerics; using SixLabors.ImageSharp.ColorSpaces; using Xunit; @@ -14,24 +16,26 @@ namespace SixLabors.ImageSharp.Tests.Colorspaces /// public class ColorSpaceEqualityTests { - public static readonly TheoryData EmptyData = - new TheoryData + internal static readonly Dictionary EmptyDataLookup = + new Dictionary { - CieLab.Empty, - CieLch.Empty, - CieLchuv.Empty, - CieLuv.Empty, - CieXyz.Empty, - CieXyy.Empty, - Hsl.Empty, - Hsl.Empty, - HunterLab.Empty, - Lms.Empty, - LinearRgb.Empty, - Rgb.Empty, - YCbCr.Empty + {nameof( CieLab), CieLab.Empty }, + {nameof( CieLch), CieLch.Empty }, + {nameof( CieLchuv), CieLchuv.Empty }, + {nameof( CieLuv), CieLuv.Empty }, + {nameof( CieXyz), CieXyz.Empty }, + {nameof( CieXyy), CieXyy.Empty }, + {nameof( Hsl), Hsl.Empty }, + {nameof( Hsl), Hsl.Empty }, + {nameof( HunterLab), HunterLab.Empty }, + {nameof( Lms), Lms.Empty }, + {nameof( LinearRgb), LinearRgb.Empty }, + {nameof( Rgb), Rgb.Empty }, + {nameof( YCbCr), YCbCr.Empty } }; + public static readonly IEnumerable EmptyData = EmptyDataLookup.Select(x => new [] { x.Key }); + public static readonly TheoryData EqualityData = new TheoryData { @@ -139,10 +143,11 @@ namespace SixLabors.ImageSharp.Tests.Colorspaces [Theory] [MemberData(nameof(EmptyData))] - public void Vector_Equals_WhenTrue(IColorVector color) + public void Vector_Equals_WhenTrue(string color) { + IColorVector colorVector = EmptyDataLookup[color]; // Act - bool equal = color.Vector.Equals(Vector3.Zero); + bool equal = colorVector.Vector.Equals(Vector3.Zero); // Assert Assert.True(equal); diff --git a/tests/ImageSharp.Tests/Drawing/FillRegionProcessorTests.cs b/tests/ImageSharp.Tests/Drawing/FillRegionProcessorTests.cs index fbdd04e64e..9540ee81bd 100644 --- a/tests/ImageSharp.Tests/Drawing/FillRegionProcessorTests.cs +++ b/tests/ImageSharp.Tests/Drawing/FillRegionProcessorTests.cs @@ -10,6 +10,7 @@ using SixLabors.ImageSharp.Drawing.Processors; using SixLabors.ImageSharp.PixelFormats; using Moq; using Xunit; +using SixLabors.ImageSharp.Drawing.Brushes; namespace SixLabors.ImageSharp.Tests.Drawing { diff --git a/tests/ImageSharp.Tests/Formats/Bmp/BmpEncoderTests.cs b/tests/ImageSharp.Tests/Formats/Bmp/BmpEncoderTests.cs index c3ab62b0da..ffadb8a9e6 100644 --- a/tests/ImageSharp.Tests/Formats/Bmp/BmpEncoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Bmp/BmpEncoderTests.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.Formats.Bmp; using SixLabors.ImageSharp.PixelFormats; using Xunit; diff --git a/tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs b/tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs index 9cc2ebec49..d04c49a988 100644 --- a/tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs @@ -3,6 +3,7 @@ using System.Text; using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.Formats.Gif; using SixLabors.ImageSharp.PixelFormats; using SixLabors.Primitives; using Xunit; diff --git a/tests/ImageSharp.Tests/Formats/Gif/GifEncoderTests.cs b/tests/ImageSharp.Tests/Formats/Gif/GifEncoderTests.cs index fb806e244d..a06e36e2a6 100644 --- a/tests/ImageSharp.Tests/Formats/Gif/GifEncoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Gif/GifEncoderTests.cs @@ -3,6 +3,8 @@ using System.IO; using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.Formats.Gif; +using SixLabors.ImageSharp.MetaData; using SixLabors.ImageSharp.PixelFormats; using Xunit; diff --git a/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs index e6e469aea5..1cb01a4f3c 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs @@ -15,6 +15,7 @@ namespace SixLabors.ImageSharp.Tests using System.Linq; using SixLabors.ImageSharp.Formats; + using SixLabors.ImageSharp.Formats.Jpeg; using SixLabors.ImageSharp.Formats.Jpeg.GolangPort; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison; @@ -44,7 +45,7 @@ namespace SixLabors.ImageSharp.Tests // TODO: We should make this comparer less tolerant ... private static readonly ImageComparer VeryTolerantJpegComparer = - ImageComparer.Tolerant(0.005f, pixelThresholdHammingDistance: 4); + ImageComparer.Tolerant(0.005f, perPixelManhattanThreshold: 4); // BUG: PDF.js output is wrong on spectral level! private static readonly ImageComparer PdfJsProgressiveComparer = diff --git a/tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.cs index aab03627b2..60aaea8469 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.IO; using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.Formats.Jpeg; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; using SixLabors.Primitives; diff --git a/tests/ImageSharp.Tests/Formats/Jpg/JpegProfilingBenchmarks.cs b/tests/ImageSharp.Tests/Formats/Jpg/JpegProfilingBenchmarks.cs index 4afb77eeae..c87fce6d8d 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/JpegProfilingBenchmarks.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/JpegProfilingBenchmarks.cs @@ -6,6 +6,7 @@ using System.IO; using System.Linq; using System.Numerics; using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.Formats.Jpeg; using SixLabors.ImageSharp.PixelFormats; using Xunit; using Xunit.Abstractions; diff --git a/tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs b/tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs index 68d1ac0315..836fc5b5c6 100644 --- a/tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs @@ -11,6 +11,7 @@ using Xunit; namespace SixLabors.ImageSharp.Tests { + using SixLabors.ImageSharp.Formats.Png; using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison; // TODO: Fix all bugs, and re enable Skipped and commented stuff !!! diff --git a/tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs b/tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs index c17a1c3b02..5380807562 100644 --- a/tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs @@ -6,6 +6,7 @@ using System.IO; using System.Linq; using System.Threading.Tasks; using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.Formats.Png; using SixLabors.ImageSharp.IO; using SixLabors.ImageSharp.PixelFormats; using Xunit; diff --git a/tests/ImageSharp.Tests/Formats/Png/PngSmokeTests.cs b/tests/ImageSharp.Tests/Formats/Png/PngSmokeTests.cs index 738d3de686..fc17df93d1 100644 --- a/tests/ImageSharp.Tests/Formats/Png/PngSmokeTests.cs +++ b/tests/ImageSharp.Tests/Formats/Png/PngSmokeTests.cs @@ -6,6 +6,7 @@ using Xunit; using SixLabors.ImageSharp.Formats; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison; +using SixLabors.ImageSharp.Formats.Png; namespace SixLabors.ImageSharp.Tests.Formats.Png { diff --git a/tests/ImageSharp.Tests/Image/ImageTests.cs b/tests/ImageSharp.Tests/Image/ImageTests.cs index d560900a6b..323eaf65c0 100644 --- a/tests/ImageSharp.Tests/Image/ImageTests.cs +++ b/tests/ImageSharp.Tests/Image/ImageTests.cs @@ -3,6 +3,7 @@ using System; using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.Formats.Png; using SixLabors.ImageSharp.PixelFormats; using Xunit; diff --git a/tests/ImageSharp.Tests/Image/PixelAccessorTests.cs b/tests/ImageSharp.Tests/Image/PixelAccessorTests.cs index 50aec35d6b..1ab3f2ce9f 100644 --- a/tests/ImageSharp.Tests/Image/PixelAccessorTests.cs +++ b/tests/ImageSharp.Tests/Image/PixelAccessorTests.cs @@ -42,7 +42,7 @@ namespace SixLabors.ImageSharp.Tests [WithMemberFactory(nameof(CreateTestImage), PixelTypes.All, ComponentOrder.Zyx)] [WithMemberFactory(nameof(CreateTestImage), PixelTypes.All, ComponentOrder.Xyzw)] [WithMemberFactory(nameof(CreateTestImage), PixelTypes.All, ComponentOrder.Zyxw)] - public void CopyTo_Then_CopyFrom_OnFullImageRect(TestImageProvider provider, ComponentOrder order) + internal void CopyTo_Then_CopyFrom_OnFullImageRect(TestImageProvider provider, ComponentOrder order) where TPixel : struct, IPixel { using (Image src = provider.GetImage()) @@ -72,7 +72,7 @@ namespace SixLabors.ImageSharp.Tests [WithBlankImages(16, 16, PixelTypes.All, ComponentOrder.Zyx)] [WithBlankImages(16, 16, PixelTypes.All, ComponentOrder.Xyzw)] [WithBlankImages(16, 16, PixelTypes.All, ComponentOrder.Zyxw)] - public void CopyToThenCopyFromWithOffset(TestImageProvider provider, ComponentOrder order) + internal void CopyToThenCopyFromWithOffset(TestImageProvider provider, ComponentOrder order) where TPixel : struct, IPixel { using (Image destImage = new Image(8, 8)) diff --git a/tests/ImageSharp.Tests/MetaData/ImageFrameMetaDataTests.cs b/tests/ImageSharp.Tests/MetaData/ImageFrameMetaDataTests.cs index 8b42d4f515..507401398e 100644 --- a/tests/ImageSharp.Tests/MetaData/ImageFrameMetaDataTests.cs +++ b/tests/ImageSharp.Tests/MetaData/ImageFrameMetaDataTests.cs @@ -2,6 +2,8 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.Formats.Gif; +using SixLabors.ImageSharp.MetaData; using Xunit; namespace SixLabors.ImageSharp.Tests diff --git a/tests/ImageSharp.Tests/MetaData/ImageMetaDataTests.cs b/tests/ImageSharp.Tests/MetaData/ImageMetaDataTests.cs index 09a05a2544..ee7faeca58 100644 --- a/tests/ImageSharp.Tests/MetaData/ImageMetaDataTests.cs +++ b/tests/ImageSharp.Tests/MetaData/ImageMetaDataTests.cs @@ -2,6 +2,9 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.Formats.Gif; +using SixLabors.ImageSharp.MetaData; +using SixLabors.ImageSharp.MetaData.Profiles.Exif; using SixLabors.ImageSharp.PixelFormats; using Xunit; diff --git a/tests/ImageSharp.Tests/MetaData/ImagePropertyTests.cs b/tests/ImageSharp.Tests/MetaData/ImagePropertyTests.cs index 63a51e8638..5e15d556c0 100644 --- a/tests/ImageSharp.Tests/MetaData/ImagePropertyTests.cs +++ b/tests/ImageSharp.Tests/MetaData/ImagePropertyTests.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. using System; +using SixLabors.ImageSharp.MetaData; using Xunit; namespace SixLabors.ImageSharp.Tests diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifProfileTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifProfileTests.cs index 845fbd8fa4..edeeebd28e 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifProfileTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifProfileTests.cs @@ -6,6 +6,8 @@ using System.Collections; using System.IO; using System.Linq; using System.Text; +using SixLabors.ImageSharp.MetaData; +using SixLabors.ImageSharp.MetaData.Profiles.Exif; using SixLabors.ImageSharp.PixelFormats; using Xunit; diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifReaderTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifReaderTests.cs index 802f856e42..dee6d5ff39 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifReaderTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifReaderTests.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. using System.Collections.ObjectModel; +using SixLabors.ImageSharp.MetaData.Profiles.Exif; using Xunit; namespace SixLabors.ImageSharp.Tests diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifTagDescriptionAttributeTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifTagDescriptionAttributeTests.cs index a2b2c6e70c..2b8d4d7160 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifTagDescriptionAttributeTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifTagDescriptionAttributeTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using SixLabors.ImageSharp.MetaData.Profiles.Exif; using Xunit; namespace SixLabors.ImageSharp.Tests diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifValueTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifValueTests.cs index 3fbd1d9f0b..8bc192af5c 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifValueTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifValueTests.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. using System.Linq; +using SixLabors.ImageSharp.MetaData.Profiles.Exif; using SixLabors.ImageSharp.PixelFormats; using Xunit; diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.CurvesTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.CurvesTests.cs index 6a08c98e54..beca4db49f 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.CurvesTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.CurvesTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using SixLabors.ImageSharp.MetaData.Profiles.Icc; using Xunit; namespace SixLabors.ImageSharp.Tests.Icc diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.LutTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.LutTests.cs index 1271fc2680..43a1ed7f47 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.LutTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.LutTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using SixLabors.ImageSharp.MetaData.Profiles.Icc; using Xunit; namespace SixLabors.ImageSharp.Tests.Icc diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.MatrixTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.MatrixTests.cs index 8395f70158..328cc3fa6a 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.MatrixTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.MatrixTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using SixLabors.ImageSharp.MetaData.Profiles.Icc; using Xunit; namespace SixLabors.ImageSharp.Tests.Icc diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.MultiProcessElementTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.MultiProcessElementTests.cs index 610efaf6a7..5599e80d19 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.MultiProcessElementTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.MultiProcessElementTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using SixLabors.ImageSharp.MetaData.Profiles.Icc; using Xunit; namespace SixLabors.ImageSharp.Tests.Icc diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.NonPrimitivesTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.NonPrimitivesTests.cs index 0c33ad9fe1..880fa0607e 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.NonPrimitivesTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.NonPrimitivesTests.cs @@ -3,6 +3,7 @@ using System; using System.Numerics; +using SixLabors.ImageSharp.MetaData.Profiles.Icc; using Xunit; namespace SixLabors.ImageSharp.Tests.Icc diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.PrimitivesTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.PrimitivesTests.cs index 7975da04c3..f8924c43cc 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.PrimitivesTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.PrimitivesTests.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. using System; +using SixLabors.ImageSharp.MetaData.Profiles.Icc; using Xunit; namespace SixLabors.ImageSharp.Tests.Icc diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.TagDataEntryTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.TagDataEntryTests.cs index c75f6b96f4..aba587846a 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.TagDataEntryTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.TagDataEntryTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using SixLabors.ImageSharp.MetaData.Profiles.Icc; using Xunit; namespace SixLabors.ImageSharp.Tests.Icc diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReaderTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReaderTests.cs index 3c66d9a4ad..a3e5a20f68 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReaderTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReaderTests.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. using System; +using SixLabors.ImageSharp.MetaData.Profiles.Icc; using Xunit; namespace SixLabors.ImageSharp.Tests.Icc diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.CurvesTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.CurvesTests.cs index 85d091ec76..6a47c988cd 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.CurvesTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.CurvesTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using SixLabors.ImageSharp.MetaData.Profiles.Icc; using Xunit; namespace SixLabors.ImageSharp.Tests.Icc diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.LutTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.LutTests.cs index 6bbdb80386..9286ac815e 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.LutTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.LutTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using SixLabors.ImageSharp.MetaData.Profiles.Icc; using Xunit; namespace SixLabors.ImageSharp.Tests.Icc diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.MatrixTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.MatrixTests.cs index 20c7c3bead..437c223fa9 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.MatrixTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.MatrixTests.cs @@ -3,6 +3,7 @@ using System.Numerics; using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.MetaData.Profiles.Icc; using Xunit; namespace SixLabors.ImageSharp.Tests.Icc diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.MultiProcessElementTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.MultiProcessElementTests.cs index bf80b53701..43165c617d 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.MultiProcessElementTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.MultiProcessElementTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using SixLabors.ImageSharp.MetaData.Profiles.Icc; using Xunit; namespace SixLabors.ImageSharp.Tests.Icc diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.NonPrimitivesTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.NonPrimitivesTests.cs index d97e32de89..eda6a33c74 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.NonPrimitivesTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.NonPrimitivesTests.cs @@ -3,6 +3,7 @@ using System; using System.Numerics; +using SixLabors.ImageSharp.MetaData.Profiles.Icc; using Xunit; namespace SixLabors.ImageSharp.Tests.Icc diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.PrimitivesTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.PrimitivesTests.cs index 76ada231e2..56a4f8c0ca 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.PrimitivesTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.PrimitivesTests.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. using System; +using SixLabors.ImageSharp.MetaData.Profiles.Icc; using Xunit; namespace SixLabors.ImageSharp.Tests.Icc diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.TagDataEntryTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.TagDataEntryTests.cs index a026cb8a0c..f3ef5effbe 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.TagDataEntryTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.TagDataEntryTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using SixLabors.ImageSharp.MetaData.Profiles.Icc; using Xunit; namespace SixLabors.ImageSharp.Tests.Icc diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriterTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriterTests.cs index 2d0aa920b0..a3f796275a 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriterTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriterTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using SixLabors.ImageSharp.MetaData.Profiles.Icc; using Xunit; namespace SixLabors.ImageSharp.Tests.Icc diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/IccReaderTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/IccReaderTests.cs index 6c11182e09..b3215ee7ae 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/IccReaderTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/IccReaderTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using SixLabors.ImageSharp.MetaData.Profiles.Icc; using Xunit; namespace SixLabors.ImageSharp.Tests.Icc diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/IccWriterTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/IccWriterTests.cs index e845535304..99ae73f49a 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/IccWriterTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/IccWriterTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using SixLabors.ImageSharp.MetaData.Profiles.Icc; using Xunit; namespace SixLabors.ImageSharp.Tests.Icc diff --git a/tests/ImageSharp.Tests/Numerics/RationalTests.cs b/tests/ImageSharp.Tests/Numerics/RationalTests.cs index c6c59915d6..61eeed01f5 100644 --- a/tests/ImageSharp.Tests/Numerics/RationalTests.cs +++ b/tests/ImageSharp.Tests/Numerics/RationalTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using SixLabors.ImageSharp.MetaData.Profiles.Exif; using Xunit; namespace SixLabors.ImageSharp.Tests diff --git a/tests/ImageSharp.Tests/Numerics/SignedRationalTests.cs b/tests/ImageSharp.Tests/Numerics/SignedRationalTests.cs index d4b3421518..af5388d1cf 100644 --- a/tests/ImageSharp.Tests/Numerics/SignedRationalTests.cs +++ b/tests/ImageSharp.Tests/Numerics/SignedRationalTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using SixLabors.ImageSharp.MetaData.Profiles.Exif; using Xunit; namespace SixLabors.ImageSharp.Tests diff --git a/tests/ImageSharp.Tests/Processing/Binarization/DitherTests.cs b/tests/ImageSharp.Tests/Processing/Binarization/DitherTests.cs index 8aef37d4d1..94241d0071 100644 --- a/tests/ImageSharp.Tests/Processing/Binarization/DitherTests.cs +++ b/tests/ImageSharp.Tests/Processing/Binarization/DitherTests.cs @@ -2,7 +2,6 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.Dithering; -using SixLabors.ImageSharp.Dithering.Ordered; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing.Processors; using Moq; diff --git a/tests/ImageSharp.Tests/Processing/Processors/Binarization/BinaryThresholdTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Binarization/BinaryThresholdTest.cs index 86a66eab04..3daeecfc75 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Binarization/BinaryThresholdTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Binarization/BinaryThresholdTest.cs @@ -44,7 +44,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Binarization image.Mutate(x => x.BinaryThreshold(value, bounds)); image.DebugSave(provider, value); - ImageComparer.Tolerant().EnsureProcessorChangesAreConstrained(source, image, bounds); + ImageComparer.Tolerant().VerifySimilarityIgnoreRegion(source, image, bounds); } } } diff --git a/tests/ImageSharp.Tests/Processing/Processors/Binarization/DitherTests.cs b/tests/ImageSharp.Tests/Processing/Processors/Binarization/DitherTests.cs index 75fd32fc82..9a6d24226b 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Binarization/DitherTests.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Binarization/DitherTests.cs @@ -1,8 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using SixLabors.ImageSharp.Dithering; -using SixLabors.ImageSharp.Dithering.Ordered; +using SixLabors.ImageSharp.Dithering; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison; @@ -23,26 +22,26 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Binarization public static readonly TheoryData Ditherers = new TheoryData { - { "Ordered", new Ordered() }, - { "Bayer", new Bayer() } + { "Ordered", new OrderedDither() }, + { "Bayer", new BayerDither() } }; public static readonly TheoryData ErrorDiffusers = new TheoryData { - { "Atkinson", new Atkinson() }, - { "Burks", new Burks() }, - { "FloydSteinberg", new FloydSteinberg() }, - { "JarvisJudiceNinke", new JarvisJudiceNinke() }, - { "Sierra2", new Sierra2() }, - { "Sierra3", new Sierra3() }, - { "SierraLite", new SierraLite() }, - { "Stucki", new Stucki() }, + { "Atkinson", new AtkinsonDiffuser() }, + { "Burks", new BurksDiffuser() }, + { "FloydSteinberg", new FloydSteinbergDiffuser() }, + { "JarvisJudiceNinke", new JarvisJudiceNinkeDiffuser() }, + { "Sierra2", new Sierra2Diffuser() }, + { "Sierra3", new Sierra3Diffuser() }, + { "SierraLite", new SierraLiteDiffuser() }, + { "Stucki", new StuckiDiffuser() }, }; - private static IOrderedDither DefaultDitherer => new Ordered(); + private static IOrderedDither DefaultDitherer => new OrderedDither(); - private static IErrorDiffuser DefaultErrorDiffuser => new Atkinson(); + private static IErrorDiffuser DefaultErrorDiffuser => new AtkinsonDiffuser(); [Theory] [WithFileCollection(nameof(CommonTestImages), nameof(Ditherers), DefaultPixelType)] @@ -107,12 +106,11 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Binarization image.Mutate(x => x.Dither(DefaultDitherer, bounds)); image.DebugSave(provider); - ImageComparer.Tolerant().EnsureProcessorChangesAreConstrained(source, image, bounds); + ImageComparer.Tolerant().VerifySimilarityIgnoreRegion(source, image, bounds); } } - // TODO: Does not work because of a bug! Fix it! - [Theory(Skip = "TODO: Does not work because of a bug! Fix it!")] + [Theory] [WithFile(TestImages.Png.CalliphoraPartial, DefaultPixelType)] public void ApplyDiffusionFilterInBox(TestImageProvider provider) where TPixel : struct, IPixel @@ -125,7 +123,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Binarization image.Mutate(x => x.Dither(DefaultErrorDiffuser, .5F, bounds)); image.DebugSave(provider); - ImageComparer.Tolerant().EnsureProcessorChangesAreConstrained(source, image, bounds); + ImageComparer.Tolerant().VerifySimilarityIgnoreRegion(source, image, bounds); } } } diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/BlackWhiteTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/BlackWhiteTest.cs index d796a62aaa..c3250ccfc0 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/BlackWhiteTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/BlackWhiteTest.cs @@ -36,7 +36,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.ColorMatrix image.Mutate(x => x.BlackWhite(bounds)); image.DebugSave(provider); - ImageComparer.Tolerant().EnsureProcessorChangesAreConstrained(source, image, bounds); + ImageComparer.Tolerant().VerifySimilarityIgnoreRegion(source, image, bounds); } } } diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/ColorBlindnessTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/ColorBlindnessTest.cs index cdfbf4abdf..122ff5a640 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/ColorBlindnessTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/ColorBlindnessTest.cs @@ -50,7 +50,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.ColorMatrix image.Mutate(x => x.ColorBlindness(colorBlindness, bounds)); image.DebugSave(provider, colorBlindness.ToString()); - ImageComparer.Tolerant().EnsureProcessorChangesAreConstrained(source, image, bounds); + ImageComparer.Tolerant().VerifySimilarityIgnoreRegion(source, image, bounds); } } } diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/GrayscaleTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/GrayscaleTest.cs index 93c053bdde..ced24f596b 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/GrayscaleTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/GrayscaleTest.cs @@ -54,7 +54,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.ColorMatrix image.Mutate(x => x.Grayscale(value, bounds)); image.DebugSave(provider, value.ToString()); - ImageComparer.Tolerant().EnsureProcessorChangesAreConstrained(source, image, bounds); + ImageComparer.Tolerant().VerifySimilarityIgnoreRegion(source, image, bounds); } } } diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/HueTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/HueTest.cs index 1cc146af25..5a1ea16a7e 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/HueTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/HueTest.cs @@ -43,7 +43,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.ColorMatrix image.Mutate(x => x.Hue(value, bounds)); image.DebugSave(provider, value); - ImageComparer.Tolerant().EnsureProcessorChangesAreConstrained(source, image, bounds); + ImageComparer.Tolerant().VerifySimilarityIgnoreRegion(source, image, bounds); } } } diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/KodachromeTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/KodachromeTest.cs index dec41da547..ebf163ab8d 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/KodachromeTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/KodachromeTest.cs @@ -36,7 +36,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.ColorMatrix image.Mutate(x => x.Kodachrome(bounds)); image.DebugSave(provider); - ImageComparer.Tolerant().EnsureProcessorChangesAreConstrained(source, image, bounds); + ImageComparer.Tolerant().VerifySimilarityIgnoreRegion(source, image, bounds); } } } diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/LomographTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/LomographTest.cs index 5f662a7619..48a58580a1 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/LomographTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/LomographTest.cs @@ -36,7 +36,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.ColorMatrix image.Mutate(x => x.Lomograph(bounds)); image.DebugSave(provider); - ImageComparer.Tolerant().EnsureProcessorChangesAreConstrained(source, image, bounds); + ImageComparer.Tolerant().VerifySimilarityIgnoreRegion(source, image, bounds); } } } diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/PolaroidTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/PolaroidTest.cs index de66422542..2e61e3f02b 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/PolaroidTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/PolaroidTest.cs @@ -36,7 +36,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.ColorMatrix image.Mutate(x => x.Polaroid(bounds)); image.DebugSave(provider); - ImageComparer.Tolerant().EnsureProcessorChangesAreConstrained(source, image, bounds); + ImageComparer.Tolerant().VerifySimilarityIgnoreRegion(source, image, bounds); } } } diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SaturationTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SaturationTest.cs index 5cbb1ba814..2532a7fe79 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SaturationTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SaturationTest.cs @@ -43,7 +43,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.ColorMatrix image.Mutate(x => x.Saturation(value, bounds)); image.DebugSave(provider, value); - ImageComparer.Tolerant().EnsureProcessorChangesAreConstrained(source, image, bounds); + ImageComparer.Tolerant().VerifySimilarityIgnoreRegion(source, image, bounds); } } } diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SepiaTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SepiaTest.cs index fbdaee82c1..28b1f6256a 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SepiaTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SepiaTest.cs @@ -36,7 +36,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.ColorMatrix image.Mutate(x => x.Sepia(bounds)); image.DebugSave(provider); - ImageComparer.Tolerant().EnsureProcessorChangesAreConstrained(source, image, bounds); + ImageComparer.Tolerant().VerifySimilarityIgnoreRegion(source, image, bounds); } } } diff --git a/tests/ImageSharp.Tests/Processing/Processors/Convolution/BoxBlurTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Convolution/BoxBlurTest.cs index c6150c5ba8..94af7aa37e 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Convolution/BoxBlurTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Convolution/BoxBlurTest.cs @@ -43,7 +43,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Convolution image.Mutate(x => x.BoxBlur(value, bounds)); image.DebugSave(provider, value); - ImageComparer.Tolerant().EnsureProcessorChangesAreConstrained(source, image, bounds); + ImageComparer.Tolerant().VerifySimilarityIgnoreRegion(source, image, bounds); } } } diff --git a/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianBlurTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianBlurTest.cs index b97ab7f602..3508d544be 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianBlurTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianBlurTest.cs @@ -43,7 +43,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Convolution image.Mutate(x => x.GaussianBlur(value, bounds)); image.DebugSave(provider, value); - ImageComparer.Tolerant().EnsureProcessorChangesAreConstrained(source, image, bounds); + ImageComparer.Tolerant().VerifySimilarityIgnoreRegion(source, image, bounds); } } } diff --git a/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianSharpenTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianSharpenTest.cs index 5d9db0b811..4775444a5a 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianSharpenTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianSharpenTest.cs @@ -43,7 +43,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Convolution image.Mutate(x => x.GaussianSharpen(value, bounds)); image.DebugSave(provider, value); - ImageComparer.Tolerant().EnsureProcessorChangesAreConstrained(source, image, bounds); + ImageComparer.Tolerant().VerifySimilarityIgnoreRegion(source, image, bounds); } } } diff --git a/tests/ImageSharp.Tests/Processing/Processors/Effects/AlphaTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Effects/AlphaTest.cs index 66514e540f..7f2840f2c8 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Effects/AlphaTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Effects/AlphaTest.cs @@ -43,7 +43,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects image.Mutate(x => x.Alpha(value, bounds)); image.DebugSave(provider, value); - ImageComparer.Tolerant().EnsureProcessorChangesAreConstrained(source, image, bounds); + ImageComparer.Tolerant().VerifySimilarityIgnoreRegion(source, image, bounds); } } } diff --git a/tests/ImageSharp.Tests/Processing/Processors/Effects/BackgroundColorTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Effects/BackgroundColorTest.cs index bea9bfffc4..2dd44b3a76 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Effects/BackgroundColorTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Effects/BackgroundColorTest.cs @@ -36,7 +36,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects image.Mutate(x => x.BackgroundColor(NamedColors.HotPink, bounds)); image.DebugSave(provider); - ImageComparer.Tolerant().EnsureProcessorChangesAreConstrained(source, image, bounds); + ImageComparer.Tolerant().VerifySimilarityIgnoreRegion(source, image, bounds); } } } diff --git a/tests/ImageSharp.Tests/Processing/Processors/Effects/BrightnessTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Effects/BrightnessTest.cs index 2d039e9019..9bfed05b95 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Effects/BrightnessTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Effects/BrightnessTest.cs @@ -43,7 +43,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects image.Mutate(x => x.Brightness(value, bounds)); image.DebugSave(provider, value); - ImageComparer.Tolerant().EnsureProcessorChangesAreConstrained(source, image, bounds); + ImageComparer.Tolerant().VerifySimilarityIgnoreRegion(source, image, bounds); } } } diff --git a/tests/ImageSharp.Tests/Processing/Processors/Effects/ContrastTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Effects/ContrastTest.cs index 8ae054c382..f1e33db88b 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Effects/ContrastTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Effects/ContrastTest.cs @@ -43,7 +43,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects image.Mutate(x => x.Contrast(value, bounds)); image.DebugSave(provider, value); - ImageComparer.Tolerant().EnsureProcessorChangesAreConstrained(source, image, bounds); + ImageComparer.Tolerant().VerifySimilarityIgnoreRegion(source, image, bounds); } } } diff --git a/tests/ImageSharp.Tests/Processing/Processors/Effects/InvertTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Effects/InvertTest.cs index ec93a92119..5930236774 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Effects/InvertTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Effects/InvertTest.cs @@ -36,7 +36,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects image.Mutate(x => x.Invert(bounds)); image.DebugSave(provider); - ImageComparer.Tolerant().EnsureProcessorChangesAreConstrained(source, image, bounds); + ImageComparer.Tolerant().VerifySimilarityIgnoreRegion(source, image, bounds); } } } diff --git a/tests/ImageSharp.Tests/Processing/Processors/Effects/OilPaintTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Effects/OilPaintTest.cs index 1a45c6eb5d..608fcf10cf 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Effects/OilPaintTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Effects/OilPaintTest.cs @@ -43,7 +43,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects image.Mutate(x => x.OilPaint(levels, brushSize, bounds)); image.DebugSave(provider, string.Join("-", levels, brushSize)); - ImageComparer.Tolerant().EnsureProcessorChangesAreConstrained(source, image, bounds); + ImageComparer.Tolerant().VerifySimilarityIgnoreRegion(source, image, bounds); } } } diff --git a/tests/ImageSharp.Tests/Processing/Processors/Effects/PixelateTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Effects/PixelateTest.cs index ef7cfe0adf..b3f1ee3a28 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Effects/PixelateTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Effects/PixelateTest.cs @@ -77,7 +77,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects } } - ImageComparer.Tolerant().EnsureProcessorChangesAreConstrained(source, image, bounds); + ImageComparer.Tolerant().VerifySimilarityIgnoreRegion(source, image, bounds); } } } diff --git a/tests/ImageSharp.Tests/Processing/Processors/Overlays/GlowTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Overlays/GlowTest.cs index 0b0d5e0a24..5693b6d755 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Overlays/GlowTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Overlays/GlowTest.cs @@ -60,7 +60,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Overlays image.Mutate(x => x.Glow(bounds)); image.DebugSave(provider); - ImageComparer.Tolerant().EnsureProcessorChangesAreConstrained(source, image, bounds); + ImageComparer.Tolerant().VerifySimilarityIgnoreRegion(source, image, bounds); } } } diff --git a/tests/ImageSharp.Tests/Processing/Processors/Overlays/VignetteTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Overlays/VignetteTest.cs index f968b50f97..0d9c3e89b3 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Overlays/VignetteTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Overlays/VignetteTest.cs @@ -60,7 +60,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Overlays image.Mutate(x => x.Vignette(bounds)); image.DebugSave(provider); - ImageComparer.Tolerant().EnsureProcessorChangesAreConstrained(source, image, bounds); + ImageComparer.Tolerant().VerifySimilarityIgnoreRegion(source, image, bounds); } } } diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/AutoOrientTests.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/AutoOrientTests.cs index cb9414b958..161ac15e33 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/AutoOrientTests.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/AutoOrientTests.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. using System; +using SixLabors.ImageSharp.MetaData.Profiles.Exif; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; using Xunit; diff --git a/tests/ImageSharp.Tests/TestDataIcc/IccTestDataCurves.cs b/tests/ImageSharp.Tests/TestDataIcc/IccTestDataCurves.cs index 2b13e5bad2..b39892a81d 100644 --- a/tests/ImageSharp.Tests/TestDataIcc/IccTestDataCurves.cs +++ b/tests/ImageSharp.Tests/TestDataIcc/IccTestDataCurves.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. using System.Numerics; +using SixLabors.ImageSharp.MetaData.Profiles.Icc; namespace SixLabors.ImageSharp.Tests { diff --git a/tests/ImageSharp.Tests/TestDataIcc/IccTestDataLut.cs b/tests/ImageSharp.Tests/TestDataIcc/IccTestDataLut.cs index b4a512bd1e..4ab0b0f6b0 100644 --- a/tests/ImageSharp.Tests/TestDataIcc/IccTestDataLut.cs +++ b/tests/ImageSharp.Tests/TestDataIcc/IccTestDataLut.cs @@ -1,6 +1,8 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using SixLabors.ImageSharp.MetaData.Profiles.Icc; + namespace SixLabors.ImageSharp.Tests { internal static class IccTestDataLut diff --git a/tests/ImageSharp.Tests/TestDataIcc/IccTestDataMultiProcessElements.cs b/tests/ImageSharp.Tests/TestDataIcc/IccTestDataMultiProcessElements.cs index d29906d426..fb648198da 100644 --- a/tests/ImageSharp.Tests/TestDataIcc/IccTestDataMultiProcessElements.cs +++ b/tests/ImageSharp.Tests/TestDataIcc/IccTestDataMultiProcessElements.cs @@ -1,6 +1,8 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. +using SixLabors.ImageSharp.MetaData.Profiles.Icc; + namespace SixLabors.ImageSharp.Tests { internal static class IccTestDataMultiProcessElement diff --git a/tests/ImageSharp.Tests/TestDataIcc/IccTestDataNonPrimitives.cs b/tests/ImageSharp.Tests/TestDataIcc/IccTestDataNonPrimitives.cs index 370b881682..3b8c3321a6 100644 --- a/tests/ImageSharp.Tests/TestDataIcc/IccTestDataNonPrimitives.cs +++ b/tests/ImageSharp.Tests/TestDataIcc/IccTestDataNonPrimitives.cs @@ -4,6 +4,7 @@ using System; using System.Globalization; using System.Numerics; +using SixLabors.ImageSharp.MetaData.Profiles.Icc; namespace SixLabors.ImageSharp.Tests { diff --git a/tests/ImageSharp.Tests/TestDataIcc/IccTestDataProfiles.cs b/tests/ImageSharp.Tests/TestDataIcc/IccTestDataProfiles.cs index ee32aa934f..3cf66ffedd 100644 --- a/tests/ImageSharp.Tests/TestDataIcc/IccTestDataProfiles.cs +++ b/tests/ImageSharp.Tests/TestDataIcc/IccTestDataProfiles.cs @@ -3,6 +3,7 @@ using System; using System.Numerics; +using SixLabors.ImageSharp.MetaData.Profiles.Icc; namespace SixLabors.ImageSharp.Tests { diff --git a/tests/ImageSharp.Tests/TestDataIcc/IccTestDataTagDataEntry.cs b/tests/ImageSharp.Tests/TestDataIcc/IccTestDataTagDataEntry.cs index 240bd4fa53..9d5e621aa0 100644 --- a/tests/ImageSharp.Tests/TestDataIcc/IccTestDataTagDataEntry.cs +++ b/tests/ImageSharp.Tests/TestDataIcc/IccTestDataTagDataEntry.cs @@ -3,6 +3,7 @@ using System.Globalization; using System.Numerics; +using SixLabors.ImageSharp.MetaData.Profiles.Icc; namespace SixLabors.ImageSharp.Tests { diff --git a/tests/ImageSharp.Tests/TestUtilities/ImageComparison/ImageComparer.cs b/tests/ImageSharp.Tests/TestUtilities/ImageComparison/ImageComparer.cs index ff9756e031..74f46a869a 100644 --- a/tests/ImageSharp.Tests/TestUtilities/ImageComparison/ImageComparer.cs +++ b/tests/ImageSharp.Tests/TestUtilities/ImageComparison/ImageComparer.cs @@ -17,9 +17,9 @@ namespace SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison public static ImageComparer Tolerant( float imageThreshold = TolerantImageComparer.DefaultImageThreshold, - int pixelThresholdHammingDistance = 0) + int perPixelManhattanThreshold = 0) { - return new TolerantImageComparer(imageThreshold, pixelThresholdHammingDistance); + return new TolerantImageComparer(imageThreshold, perPixelManhattanThreshold); } public abstract ImageSimilarityReport CompareImagesOrFrames( @@ -43,7 +43,7 @@ namespace SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison { result.Add(report); } - + if (expected.Frames.Count != actual.Frames.Count) { throw new Exception("Frame count does not match!"); @@ -82,29 +82,46 @@ namespace SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison } } - /// - /// Fills the bounded area with a solid color and does a visual comparison between 2 images asserting the difference outwith - /// that area is less then a configurable threshold. - /// - /// The color of the expected image - /// The color type fo the the actual image - /// The to use - /// The expected image - /// The actual image - /// The bounds within the image has been altered - public static void EnsureProcessorChangesAreConstrained( + public static void VerifySimilarityIgnoreRegion( this ImageComparer comparer, Image expected, Image actual, - Rectangle bounds) + Rectangle ignoredRegion) where TPixelA : struct, IPixel where TPixelB : struct, IPixel { - // Draw identical shapes over the bounded and compare to ensure changes are constrained. - expected.Mutate(x => x.Fill(NamedColors.HotPink, bounds)); - actual.Mutate(x => x.Fill(NamedColors.HotPink, bounds)); + if (expected.Size() != actual.Size()) + { + throw new ImageDimensionsMismatchException(expected.Size(), actual.Size()); + } + + if (expected.Frames.Count != actual.Frames.Count) + { + throw new ImagesSimilarityException("Image frame count does not match!"); + } - comparer.VerifySimilarity(expected, actual); + IEnumerable reports = comparer.CompareImages(expected, actual); + if (reports.Any()) + { + List cleanedReports = new List(reports.Count()); + foreach (var r in reports) + { + var outsideChanges = r.Differences.Where(x => !( + ignoredRegion.X <= x.Position.X && + x.Position.X <= ignoredRegion.Right && + ignoredRegion.Y <= x.Position.Y && + x.Position.Y <= ignoredRegion.Bottom)); + if (outsideChanges.Any()) + { + cleanedReports.Add(new ImageSimilarityReport(r.ExpectedImage, r.ActualImage, outsideChanges, null)); + } + } + + if (cleanedReports.Any()) + { + throw new ImagePixelsAreDifferentException(cleanedReports); + } + } } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/TestUtilities/ImageComparison/TolerantImageComparer.cs b/tests/ImageSharp.Tests/TestUtilities/ImageComparison/TolerantImageComparer.cs index c74de50ce0..48335945c6 100644 --- a/tests/ImageSharp.Tests/TestUtilities/ImageComparison/TolerantImageComparer.cs +++ b/tests/ImageSharp.Tests/TestUtilities/ImageComparison/TolerantImageComparer.cs @@ -12,10 +12,10 @@ { public const float DefaultImageThreshold = 1.0f / (100 * 100 * 255); - public TolerantImageComparer(float imageThreshold, int pixelThresholdHammingDistance = 0) + public TolerantImageComparer(float imageThreshold, int perPixelManhattanThreshold = 0) { this.ImageThreshold = imageThreshold; - this.PixelThresholdHammingDistance = pixelThresholdHammingDistance; + this.PerPixelManhattanThreshold = perPixelManhattanThreshold; } /// @@ -26,7 +26,10 @@ /// 3. PixelA = (255,255,255,0) PixelB =(128,128,128,128) leads to 50% difference on a single pixel /// /// The total differences is the sum of all pixel differences normalized by image dimensions! - /// + /// The individual distances are calculated using the Manhattan function: + /// + /// https://en.wikipedia.org/wiki/Taxicab_geometry + /// /// ImageThresholdInPercents = 1.0/255 means that we allow one byte difference per channel on a 1x1 image /// ImageThresholdInPercents = 1.0/(100*100*255) means that we allow only one byte difference per channel on a 100x100 image /// @@ -34,9 +37,12 @@ /// /// The threshold of the individual pixels before they acumulate towards the overall difference. - /// For an individual pixel the value it's calculated as: pixel.R + pixel.G + pixel.B + pixel.A + /// For an individual pixel pair the value is the Manhattan distance of pixels: + /// + /// https://en.wikipedia.org/wiki/Taxicab_geometry + /// /// - public int PixelThresholdHammingDistance { get; } + public int PerPixelManhattanThreshold { get; } public override ImageSimilarityReport CompareImagesOrFrames(ImageBase expected, ImageBase actual) { @@ -66,9 +72,9 @@ for (int x = 0; x < width; x++) { - int d = GetHammingDistanceInRgbaSpace(ref aBuffer[x], ref bBuffer[x]); + int d = GetManhattanDistanceInRgbaSpace(ref aBuffer[x], ref bBuffer[x]); - if (d > this.PixelThresholdHammingDistance) + if (d > this.PerPixelManhattanThreshold) { var diff = new PixelDifference(new Point(x, y), aBuffer[x], bBuffer[x]); differences.Add(diff); @@ -92,7 +98,7 @@ } [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static int GetHammingDistanceInRgbaSpace(ref Rgba32 a, ref Rgba32 b) + private static int GetManhattanDistanceInRgbaSpace(ref Rgba32 a, ref Rgba32 b) { return Diff(a.R, b.R) + Diff(a.G, b.G) + Diff(a.B, b.B) + Diff(a.A, b.A); } diff --git a/tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs b/tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs index 7265fd9a1c..9d15023ead 100644 --- a/tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs +++ b/tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs @@ -12,6 +12,10 @@ using SixLabors.ImageSharp.Tests.TestUtilities.ReferenceCodecs; namespace SixLabors.ImageSharp.Tests { using System.Runtime.InteropServices; + using SixLabors.ImageSharp.Formats.Bmp; + using SixLabors.ImageSharp.Formats.Gif; + using SixLabors.ImageSharp.Formats.Jpeg; + using SixLabors.ImageSharp.Formats.Png; public static class TestEnvironment { diff --git a/tests/ImageSharp.Tests/TestUtilities/Tests/ImageComparerTests.cs b/tests/ImageSharp.Tests/TestUtilities/Tests/ImageComparerTests.cs index 45e20f3fbc..29acabdc4f 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Tests/ImageComparerTests.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Tests/ImageComparerTests.cs @@ -96,7 +96,7 @@ namespace SixLabors.ImageSharp.Tests ImagingTestCaseUtility.ModifyPixel(clone, 1, 0, 10); ImagingTestCaseUtility.ModifyPixel(clone, 2, 0, 10); - var comparer = ImageComparer.Tolerant(pixelThresholdHammingDistance: 42); + var comparer = ImageComparer.Tolerant(perPixelManhattanThreshold: 42); comparer.VerifySimilarity(image, clone); } } diff --git a/tests/ImageSharp.Tests/TestUtilities/Tests/TestEnvironmentTests.cs b/tests/ImageSharp.Tests/TestUtilities/Tests/TestEnvironmentTests.cs index a6becdbd63..a5bf0a46c4 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Tests/TestEnvironmentTests.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Tests/TestEnvironmentTests.cs @@ -5,6 +5,8 @@ using System; using System.IO; using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.Formats.Gif; +using SixLabors.ImageSharp.Formats.Jpeg; using SixLabors.ImageSharp.Tests.TestUtilities.ReferenceCodecs; using Xunit; using Xunit.Abstractions;