diff --git a/src/ImageSharp/Advanced/AdvancedImageExtensions.cs b/src/ImageSharp/Advanced/AdvancedImageExtensions.cs index 63ccea4e66..bdcb4c10f1 100644 --- a/src/ImageSharp/Advanced/AdvancedImageExtensions.cs +++ b/src/ImageSharp/Advanced/AdvancedImageExtensions.cs @@ -19,7 +19,7 @@ public static class AdvancedImageExtensions /// Gets the configuration for the image. /// /// The Pixel format. - /// The source image + /// The source image. /// Returns the configuration. public static Configuration GetConfiguration(this Image source) where TPixel : struct, IPixel @@ -150,7 +150,7 @@ internal static Memory GetPixelRowMemory(this Image sour /// /// Gets the assigned to 'source'. /// - /// The source image + /// The source image. /// Returns the configuration. internal static MemoryAllocator GetMemoryAllocator(this IConfigurable source) => GetConfiguration(source).MemoryAllocator; @@ -185,7 +185,7 @@ private static Span GetSpan(IPixelSource source, int row /// The source. /// The row. /// - /// The span returned from Pixel source + /// The span returned from Pixel source. /// private static Span GetSpan(Buffer2D source, int row) where TPixel : struct, IPixel diff --git a/src/ImageSharp/Advanced/IPixelSource.cs b/src/ImageSharp/Advanced/IPixelSource.cs index 19616d7427..a321e877ba 100644 --- a/src/ImageSharp/Advanced/IPixelSource.cs +++ b/src/ImageSharp/Advanced/IPixelSource.cs @@ -3,7 +3,6 @@ using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.Memory; namespace SixLabors.ImageSharp.Advanced { diff --git a/src/ImageSharp/ColorSpaces/CieLch.cs b/src/ImageSharp/ColorSpaces/CieLch.cs index 074bc1516b..99d4c09e97 100644 --- a/src/ImageSharp/ColorSpaces/CieLch.cs +++ b/src/ImageSharp/ColorSpaces/CieLch.cs @@ -13,15 +13,15 @@ namespace SixLabors.ImageSharp.ColorSpaces /// public readonly struct CieLch : IEquatable { - private static readonly Vector3 Min = new Vector3(0, -200, 0); - private static readonly Vector3 Max = new Vector3(100, 200, 360); - /// /// D50 standard illuminant. /// Used when reference white is not specified explicitly. /// public static readonly CieXyz DefaultWhitePoint = Illuminants.D50; + private static readonly Vector3 Min = new Vector3(0, -200, 0); + private static readonly Vector3 Max = new Vector3(100, 200, 360); + /// /// Gets the lightness dimension. /// A value ranging between 0 (black), 100 (diffuse white) or higher (specular white). diff --git a/src/ImageSharp/ColorSpaces/CieXyz.cs b/src/ImageSharp/ColorSpaces/CieXyz.cs index 30521476e5..6c5adcb219 100644 --- a/src/ImageSharp/ColorSpaces/CieXyz.cs +++ b/src/ImageSharp/ColorSpaces/CieXyz.cs @@ -26,7 +26,7 @@ namespace SixLabors.ImageSharp.ColorSpaces public readonly float Y; /// - /// Gets the Z component. Quasi-equal to blue stimulation, or the S cone response + /// Gets the Z component. Quasi-equal to blue stimulation, or the S cone response. /// A value usually ranging between 0 and 1. /// public readonly float Z; diff --git a/src/ImageSharp/ColorSpaces/Cmyk.cs b/src/ImageSharp/ColorSpaces/Cmyk.cs index 04901126c1..c2331c3798 100644 --- a/src/ImageSharp/ColorSpaces/Cmyk.cs +++ b/src/ImageSharp/ColorSpaces/Cmyk.cs @@ -78,7 +78,7 @@ public Cmyk(Vector4 vector) public static bool operator ==(Cmyk left, Cmyk right) => left.Equals(right); /// - /// Compares two objects for inequality + /// Compares two objects for inequality. /// /// The on the left side of the operand. /// The on the right side of the operand. diff --git a/src/ImageSharp/ColorSpaces/Companding/SRgbCompanding.cs b/src/ImageSharp/ColorSpaces/Companding/SRgbCompanding.cs index bbd454fbe8..cc30c3632d 100644 --- a/src/ImageSharp/ColorSpaces/Companding/SRgbCompanding.cs +++ b/src/ImageSharp/ColorSpaces/Companding/SRgbCompanding.cs @@ -9,7 +9,7 @@ namespace SixLabors.ImageSharp.ColorSpaces.Companding { /// - /// Implements sRGB companding + /// Implements sRGB companding. /// /// /// For more info see: diff --git a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLab.cs b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLab.cs index 3c197673d3..bfabbb21d5 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLab.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLab.cs @@ -19,7 +19,7 @@ public partial class ColorSpaceConverter private static readonly CieLchToCieLabConverter CieLchToCieLabConverter = new CieLchToCieLabConverter(); /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -28,12 +28,11 @@ public CieLab ToCieLab(in CieLch color) // Conversion (perserving white point) CieLab unadapted = CieLchToCieLabConverter.Convert(color); - // Adaptation return this.Adapt(unadapted); } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -54,7 +53,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -66,7 +65,7 @@ public CieLab ToCieLab(in CieLchuv color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -87,7 +86,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -99,7 +98,7 @@ public CieLab ToCieLab(in CieLuv color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -120,7 +119,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -132,7 +131,7 @@ public CieLab ToCieLab(in CieXyy color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -159,10 +158,8 @@ public void Convert(ReadOnlySpan source, Span destination) /// The public CieLab ToCieLab(in CieXyz color) { - // Adaptation CieXyz adapted = this.Adapt(color, this.whitePoint, this.targetLabWhitePoint); - // Conversion return this.cieXyzToCieLabConverter.Convert(adapted); } @@ -199,7 +196,7 @@ public CieLab ToCieLab(in Cmyk color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -220,7 +217,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -232,7 +229,7 @@ public CieLab ToCieLab(in Hsl color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -253,7 +250,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -264,7 +261,7 @@ public CieLab ToCieLab(in Hsv color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -285,7 +282,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -297,7 +294,7 @@ public CieLab ToCieLab(in HunterLab color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -318,7 +315,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -330,7 +327,7 @@ public CieLab ToCieLab(in Lms color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -351,7 +348,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -363,7 +360,7 @@ public CieLab ToCieLab(in LinearRgb color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -384,7 +381,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -396,7 +393,7 @@ public CieLab ToCieLab(in Rgb color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -429,7 +426,7 @@ public CieLab ToCieLab(in YCbCr color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors diff --git a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLch.cs b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLch.cs index 0a8607e3bc..3810736197 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLch.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLch.cs @@ -34,7 +34,7 @@ public CieLch ToCieLch(in CieLab color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -55,7 +55,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -67,7 +67,7 @@ public CieLch ToCieLch(in CieLchuv color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -88,7 +88,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -100,7 +100,7 @@ public CieLch ToCieLch(in CieLuv color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -121,7 +121,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -133,7 +133,7 @@ public CieLch ToCieLch(in CieXyy color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -166,7 +166,7 @@ public CieLch ToCieLch(in CieXyz color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -187,7 +187,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -198,7 +198,7 @@ public CieLch ToCieLch(in Cmyk color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -219,7 +219,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -231,7 +231,7 @@ public CieLch ToCieLch(in Hsl color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -252,7 +252,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -264,7 +264,7 @@ public CieLch ToCieLch(in Hsv color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -285,7 +285,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -297,7 +297,7 @@ public CieLch ToCieLch(in HunterLab color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -318,7 +318,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -330,7 +330,7 @@ public CieLch ToCieLch(in LinearRgb color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -351,7 +351,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -363,7 +363,7 @@ public CieLch ToCieLch(in Lms color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -384,7 +384,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -396,7 +396,7 @@ public CieLch ToCieLch(in Rgb color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -417,7 +417,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -429,7 +429,7 @@ public CieLch ToCieLch(in YCbCr color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors diff --git a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLchuv.cs b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLchuv.cs index 3a779ee722..6ca40af035 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLchuv.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLchuv.cs @@ -32,7 +32,7 @@ public CieLchuv ToCieLchuv(in CieLab color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -53,7 +53,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -65,7 +65,7 @@ public CieLchuv ToCieLchuv(in CieLch color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -86,21 +86,19 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The public CieLchuv ToCieLchuv(in CieLuv color) { - // Adaptation CieLuv adapted = this.Adapt(color); - // Conversion return CieLuvToCieLchuvConverter.Convert(adapted); } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -121,7 +119,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -133,7 +131,7 @@ public CieLchuv ToCieLchuv(in CieXyy color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -154,7 +152,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -166,7 +164,7 @@ public CieLchuv ToCieLchuv(in CieXyz color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -187,7 +185,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -199,7 +197,7 @@ public CieLchuv ToCieLchuv(in Cmyk color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -220,7 +218,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -253,7 +251,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -265,7 +263,7 @@ public CieLchuv ToCieLchuv(in Hsv color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -286,7 +284,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -298,7 +296,7 @@ public CieLchuv ToCieLchuv(in HunterLab color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -319,7 +317,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -331,7 +329,7 @@ public CieLchuv ToCieLchuv(in LinearRgb color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -352,7 +350,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -364,7 +362,7 @@ public CieLchuv ToCieLchuv(in Lms color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -385,7 +383,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -397,7 +395,7 @@ public CieLchuv ToCieLchuv(in Rgb color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -418,7 +416,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -429,7 +427,7 @@ public CieLchuv ToCieLchuv(in YCbCr color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors diff --git a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLuv.cs b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLuv.cs index 90eb8e34d7..316b35f37a 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLuv.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLuv.cs @@ -17,7 +17,7 @@ public partial class ColorSpaceConverter private static readonly CieLchuvToCieLuvConverter CieLchuvToCieLuvConverter = new CieLchuvToCieLuvConverter(); /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -28,7 +28,7 @@ public CieLuv ToCieLuv(in CieLab color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -49,7 +49,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -60,7 +60,7 @@ public CieLuv ToCieLuv(in CieLch color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -81,7 +81,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -95,7 +95,7 @@ public CieLuv ToCieLuv(in CieLchuv color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -116,7 +116,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -127,7 +127,7 @@ public CieLuv ToCieLuv(in CieXyy color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -148,7 +148,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -162,7 +162,7 @@ public CieLuv ToCieLuv(in CieXyz color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -183,7 +183,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -194,7 +194,7 @@ public CieLuv ToCieLuv(in Cmyk color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -226,7 +226,7 @@ public CieLuv ToCieLuv(in Hsl color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -247,7 +247,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -258,7 +258,7 @@ public CieLuv ToCieLuv(in Hsv color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -279,7 +279,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -290,7 +290,7 @@ public CieLuv ToCieLuv(in HunterLab color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -311,7 +311,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -322,7 +322,7 @@ public CieLuv ToCieLuv(in Lms color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -343,7 +343,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -354,7 +354,7 @@ public CieLuv ToCieLuv(in LinearRgb color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -375,7 +375,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -386,7 +386,7 @@ public CieLuv ToCieLuv(in Rgb color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -407,7 +407,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -418,10 +418,10 @@ public CieLuv ToCieLuv(in YCbCr color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// - /// The span to the source colors - /// The span to the destination colors + /// The span to the source colors. + /// The span to the destination colors. public void Convert(ReadOnlySpan source, Span destination) { Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination)); diff --git a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieXyz.cs b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieXyz.cs index fada6d9c59..2cc8437bba 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieXyz.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieXyz.cs @@ -24,7 +24,7 @@ private static readonly HunterLabToCieXyzConverter private LinearRgbToCieXyzConverter linearRgbToCieXyzConverter; /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -38,7 +38,7 @@ public CieXyz ToCieXyz(in CieLab color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -59,7 +59,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -73,7 +73,7 @@ public CieXyz ToCieXyz(in CieLch color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -94,7 +94,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -108,7 +108,7 @@ public CieXyz ToCieXyz(in CieLchuv color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -143,7 +143,7 @@ public CieXyz ToCieXyz(in CieLuv color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -164,7 +164,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -175,7 +175,7 @@ public CieXyz ToCieXyz(in CieXyy color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -196,20 +196,19 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The public CieXyz ToCieXyz(in Cmyk color) { - // Conversion var rgb = this.ToRgb(color); return this.ToCieXyz(rgb); } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -230,23 +229,22 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The public CieXyz ToCieXyz(in Hsl color) { - // Conversion var rgb = this.ToRgb(color); return this.ToCieXyz(rgb); } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// - /// The span to the source colors - /// The span to the destination colors + /// The span to the source colors. + /// The span to the destination colors. public void Convert(ReadOnlySpan source, Span destination) { Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination)); @@ -264,7 +262,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -277,7 +275,7 @@ public CieXyz ToCieXyz(in Hsv color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -298,21 +296,19 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The public CieXyz ToCieXyz(in HunterLab color) { - // Conversion CieXyz unadapted = HunterLabToCieXyzConverter.Convert(color); - // Adaptation return this.Adapt(unadapted, color.WhitePoint); } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -333,7 +329,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -343,15 +339,14 @@ public CieXyz ToCieXyz(in LinearRgb color) LinearRgbToCieXyzConverter converter = this.GetLinearRgbToCieXyzConverter(color.WorkingSpace); CieXyz unadapted = converter.Convert(color); - // Adaptation return this.Adapt(unadapted, color.WorkingSpace.WhitePoint); } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// - /// The span to the source colors - /// The span to the destination colors + /// The span to the source colors. + /// The span to the destination colors. public void Convert(ReadOnlySpan source, Span destination) { Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination)); @@ -369,18 +364,17 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The public CieXyz ToCieXyz(in Lms color) { - // Conversion return this.cieXyzAndLmsConverter.Convert(color); } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -440,7 +434,6 @@ public void Convert(ReadOnlySpan source, Span destination) /// The public CieXyz ToCieXyz(in YCbCr color) { - // Conversion var rgb = this.ToRgb(color); return this.ToCieXyz(rgb); diff --git a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Cmyk.cs b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Cmyk.cs index b798516359..00e20e25b4 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Cmyk.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Cmyk.cs @@ -17,7 +17,7 @@ public partial class ColorSpaceConverter private static readonly CmykAndRgbConverter CmykAndRgbConverter = new CmykAndRgbConverter(); /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -29,7 +29,7 @@ public Cmyk ToCmyk(in CieLab color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -50,7 +50,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -62,7 +62,7 @@ public Cmyk ToCmyk(in CieLch color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -149,7 +149,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -161,7 +161,7 @@ public Cmyk ToCmyk(in CieXyy color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -182,7 +182,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -215,7 +215,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -227,7 +227,7 @@ public Cmyk ToCmyk(in Hsl color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -248,7 +248,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -260,7 +260,7 @@ public Cmyk ToCmyk(in Hsv color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -281,7 +281,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -293,7 +293,7 @@ public Cmyk ToCmyk(in HunterLab color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -314,7 +314,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -326,7 +326,7 @@ public Cmyk ToCmyk(in LinearRgb color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -347,7 +347,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -359,9 +359,9 @@ public Cmyk ToCmyk(in Lms color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// - /// The span to the source colors + /// The span to the source colors, /// The span to the destination colors public void Convert(ReadOnlySpan source, Span destination) { @@ -380,7 +380,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -408,7 +408,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -420,7 +420,7 @@ public Cmyk ToCmyk(in YCbCr color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors diff --git a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Hsl.cs b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Hsl.cs index a7080b9749..76175f1cba 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Hsl.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Hsl.cs @@ -17,7 +17,7 @@ public partial class ColorSpaceConverter private static readonly HslAndRgbConverter HslAndRgbConverter = new HslAndRgbConverter(); /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -29,7 +29,7 @@ public Hsl ToHsl(in CieLab color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -50,7 +50,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -62,7 +62,7 @@ public Hsl ToHsl(in CieLch color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -83,7 +83,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -95,7 +95,7 @@ public Hsl ToHsl(in CieLchuv color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -116,7 +116,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -128,7 +128,7 @@ public Hsl ToHsl(in CieLuv color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -149,7 +149,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -281,7 +281,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -293,7 +293,7 @@ public Hsl ToHsl(in HunterLab color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -314,7 +314,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -326,7 +326,7 @@ public Hsl ToHsl(in LinearRgb color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -347,7 +347,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -359,7 +359,7 @@ public Hsl ToHsl(Lms color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -387,7 +387,7 @@ public void Convert(ReadOnlySpan source, Span destination) public Hsl ToHsl(in Rgb color) => HslAndRgbConverter.Convert(color); /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -408,7 +408,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -420,7 +420,7 @@ public Hsl ToHsl(in YCbCr color) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors diff --git a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Hsv.cs b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Hsv.cs index a2121203c1..e64beb3e49 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Hsv.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Hsv.cs @@ -263,7 +263,7 @@ public Hsv ToHsv(in Hsl color) /// Performs the bulk conversion from into /// /// The span to the source colors - /// The span to the destination colors + /// The span to the destination colors. public void Convert(ReadOnlySpan source, Span destination) { Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination)); diff --git a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.HunterLab.cs b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.HunterLab.cs index e5996c238e..91e5549ac8 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.HunterLab.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.HunterLab.cs @@ -13,10 +13,10 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion public partial class ColorSpaceConverter { /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// - /// The span to the source colors - /// The span to the destination colors + /// The span to the source colors. + /// The span to the destination colors. public void Convert(ReadOnlySpan source, Span destination) { Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination)); @@ -34,10 +34,10 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// - /// The span to the source colors - /// The span to the destination colors + /// The span to the source colors. + /// The span to the destination colors. public void Convert(ReadOnlySpan source, Span destination) { Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination)); @@ -55,7 +55,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -76,7 +76,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -97,10 +97,10 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// - /// The span to the source colors - /// The span to the destination colors + /// The span to the source colors. + /// The span to the destination colors. public void Convert(ReadOnlySpan source, Span destination) { Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination)); @@ -118,10 +118,10 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// - /// The span to the source colors - /// The span to the destination colors + /// The span to the source colors. + /// The span to the destination colors. public void Convert(ReadOnlySpan source, Span destination) { Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination)); @@ -139,7 +139,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -160,10 +160,10 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors - /// The span to the destination colors + /// The span to the destination colors. public void Convert(ReadOnlySpan source, Span destination) { Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination)); @@ -181,7 +181,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -223,7 +223,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -244,7 +244,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -265,7 +265,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -286,7 +286,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -297,7 +297,7 @@ public HunterLab ToHunterLab(in CieLab color) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -308,7 +308,7 @@ public HunterLab ToHunterLab(in CieLch color) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -319,7 +319,7 @@ public HunterLab ToHunterLab(in CieLchuv color) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -330,7 +330,7 @@ public HunterLab ToHunterLab(in CieLuv color) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -341,21 +341,19 @@ public HunterLab ToHunterLab(in CieXyy color) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The public HunterLab ToHunterLab(in CieXyz color) { - // Adaptation CieXyz adapted = this.Adapt(color, this.whitePoint, this.targetHunterLabWhitePoint); - // Conversion return this.cieXyzToHunterLabConverter.Convert(adapted); } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -366,7 +364,7 @@ public HunterLab ToHunterLab(in Cmyk color) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -377,7 +375,7 @@ public HunterLab ToHunterLab(in Hsl color) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -388,7 +386,7 @@ public HunterLab ToHunterLab(in Hsv color) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -399,7 +397,7 @@ public HunterLab ToHunterLab(in LinearRgb color) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -421,7 +419,7 @@ public HunterLab ToHunterLab(in Rgb color) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The diff --git a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.LinearRgb.cs b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.LinearRgb.cs index eef626be2f..4be3f0079d 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.LinearRgb.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.LinearRgb.cs @@ -17,10 +17,10 @@ public partial class ColorSpaceConverter private static readonly RgbToLinearRgbConverter RgbToLinearRgbConverter = new RgbToLinearRgbConverter(); /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// - /// The span to the source colors - /// The span to the destination colors + /// The span to the source colors. + /// The span to the destination colors. public void Convert(ReadOnlySpan source, Span destination) { Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination)); @@ -38,10 +38,10 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// - /// The span to the source colors - /// The span to the destination colors + /// The span to the source colors. + /// The span to the destination colors. public void Convert(ReadOnlySpan source, Span destination) { Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination)); @@ -59,10 +59,10 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// - /// The span to the source colors - /// The span to the destination colors + /// The span to the source colors. + /// The span to the destination colors. public void Convert(ReadOnlySpan source, Span destination) { Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination)); @@ -80,10 +80,10 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// - /// The span to the source colors - /// The span to the destination colors + /// The span to the source colors. + /// The span to the destination colors. public void Convert(ReadOnlySpan source, Span destination) { Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination)); @@ -101,10 +101,10 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// - /// The span to the source colors - /// The span to the destination colors + /// The span to the source colors. + /// The span to the destination colors. public void Convert(ReadOnlySpan source, Span destination) { Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination)); @@ -122,10 +122,10 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// - /// The span to the source colors - /// The span to the destination colors + /// The span to the source colors. + /// The span to the destination colors. public void Convert(ReadOnlySpan source, Span destination) { Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination)); @@ -143,10 +143,10 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// - /// The span to the source colors - /// The span to the destination colors + /// The span to the source colors. + /// The span to the destination colors. public void Convert(ReadOnlySpan source, Span destination) { Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination)); @@ -164,10 +164,10 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// - /// The span to the source colors - /// The span to the destination colors + /// The span to the source colors. + /// The span to the destination colors. public void Convert(ReadOnlySpan source, Span destination) { Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination)); @@ -185,10 +185,10 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// - /// The span to the source colors - /// The span to the destination colors + /// The span to the source colors. + /// The span to the destination colors. public void Convert(ReadOnlySpan source, Span destination) { Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination)); @@ -206,10 +206,10 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// - /// The span to the source colors - /// The span to the destination colors + /// The span to the source colors. + /// The span to the destination colors. public void Convert(ReadOnlySpan source, Span destination) { Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination)); @@ -227,10 +227,10 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// - /// The span to the source colors - /// The span to the destination colors + /// The span to the source colors. + /// The span to the destination colors. public void Convert(ReadOnlySpan source, Span destination) { Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination)); @@ -248,7 +248,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -269,7 +269,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -290,7 +290,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -301,7 +301,7 @@ public LinearRgb ToLinearRgb(in CieLab color) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -312,7 +312,7 @@ public LinearRgb ToLinearRgb(in CieLch color) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -323,7 +323,7 @@ public LinearRgb ToLinearRgb(in CieLchuv color) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -345,7 +345,7 @@ public LinearRgb ToLinearRgb(in CieXyy color) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -359,7 +359,7 @@ public LinearRgb ToLinearRgb(in CieXyz color) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -370,7 +370,7 @@ public LinearRgb ToLinearRgb(in Cmyk color) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -381,7 +381,7 @@ public LinearRgb ToLinearRgb(in Hsl color) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -392,7 +392,7 @@ public LinearRgb ToLinearRgb(in Hsv color) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -403,7 +403,7 @@ public LinearRgb ToLinearRgb(in HunterLab color) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -425,7 +425,7 @@ public LinearRgb ToLinearRgb(in Rgb color) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The diff --git a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.YCbCr.cs b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.YCbCr.cs index 5780f4f545..68cd34bf2e 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.YCbCr.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.YCbCr.cs @@ -17,10 +17,10 @@ public partial class ColorSpaceConverter private static readonly YCbCrAndRgbConverter YCbCrAndRgbConverter = new YCbCrAndRgbConverter(); /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// - /// The span to the source colors - /// The span to the destination colors + /// The span to the source colors. + /// The span to the destination colors. public void Convert(ReadOnlySpan source, Span destination) { Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination)); @@ -38,10 +38,10 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// - /// The span to the source colors - /// The span to the destination colors + /// The span to the source colors. + /// The span to the destination colors. public void Convert(ReadOnlySpan source, Span destination) { Guard.DestinationShouldNotBeTooShort(source, destination, nameof(destination)); @@ -59,7 +59,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -101,7 +101,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -122,7 +122,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -143,7 +143,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -164,7 +164,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -185,7 +185,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -206,7 +206,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -227,7 +227,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -248,7 +248,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Performs the bulk conversion from into + /// Performs the bulk conversion from into . /// /// The span to the source colors /// The span to the destination colors @@ -269,7 +269,7 @@ public void Convert(ReadOnlySpan source, Span destination) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -281,7 +281,7 @@ public YCbCr ToYCbCr(in CieLab color) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -293,7 +293,7 @@ public YCbCr ToYCbCr(in CieLch color) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -305,7 +305,7 @@ public YCbCr ToYCbCr(in CieLuv color) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -317,7 +317,7 @@ public YCbCr ToYCbCr(in CieXyy color) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -329,7 +329,7 @@ public YCbCr ToYCbCr(in CieXyz color) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -341,7 +341,7 @@ public YCbCr ToYCbCr(in Cmyk color) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -353,7 +353,7 @@ public YCbCr ToYCbCr(in Hsl color) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -365,7 +365,7 @@ public YCbCr ToYCbCr(in Hsv color) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -377,7 +377,7 @@ public YCbCr ToYCbCr(in HunterLab color) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -389,7 +389,7 @@ public YCbCr ToYCbCr(in LinearRgb color) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The @@ -401,7 +401,7 @@ public YCbCr ToYCbCr(in Lms color) } /// - /// Converts a into a + /// Converts a into a . /// /// The color to convert. /// The diff --git a/src/ImageSharp/ColorSpaces/Conversion/VonKriesChromaticAdaptation.cs b/src/ImageSharp/ColorSpaces/Conversion/VonKriesChromaticAdaptation.cs index 85a36331b2..a4d96d19e7 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/VonKriesChromaticAdaptation.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/VonKriesChromaticAdaptation.cs @@ -10,13 +10,13 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion { /// - /// Basic implementation of the von Kries chromatic adaptation model + /// Implementation of the von Kries chromatic adaptation model. /// /// /// Transformation described here: /// http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html /// - public class VonKriesChromaticAdaptation : IChromaticAdaptation + public sealed class VonKriesChromaticAdaptation : IChromaticAdaptation { private readonly CieXyzAndLmsConverter converter; diff --git a/src/ImageSharp/ColorSpaces/HunterLab.cs b/src/ImageSharp/ColorSpaces/HunterLab.cs index dcae65e425..402761d8c1 100644 --- a/src/ImageSharp/ColorSpaces/HunterLab.cs +++ b/src/ImageSharp/ColorSpaces/HunterLab.cs @@ -9,7 +9,7 @@ namespace SixLabors.ImageSharp.ColorSpaces { /// /// Represents an Hunter LAB color. - /// + /// . /// public readonly struct HunterLab : IEquatable { @@ -38,7 +38,7 @@ namespace SixLabors.ImageSharp.ColorSpaces public readonly float B; /// - /// Gets the reference white point of this color + /// Gets the reference white point of this color. /// public readonly CieXyz WhitePoint; @@ -117,10 +117,7 @@ public HunterLab(Vector3 vector, CieXyz whitePoint) /// [MethodImpl(InliningOptions.ShortMethod)] - public override int GetHashCode() - { - return HashCode.Combine(this.L, this.A, this.B, this.WhitePoint); - } + public override int GetHashCode() => HashCode.Combine(this.L, this.A, this.B, this.WhitePoint); /// public override string ToString() => FormattableString.Invariant($"HunterLab({this.L:#0.##}, {this.A:#0.##}, {this.B:#0.##})"); diff --git a/src/ImageSharp/ColorSpaces/Illuminants.cs b/src/ImageSharp/ColorSpaces/Illuminants.cs index ed385e02cd..d5c1b3eed5 100644 --- a/src/ImageSharp/ColorSpaces/Illuminants.cs +++ b/src/ImageSharp/ColorSpaces/Illuminants.cs @@ -8,11 +8,9 @@ namespace SixLabors.ImageSharp.ColorSpaces /// Standard illuminants provide a basis for comparing images or colors recorded under different lighting /// /// - /// Coefficients taken from: - /// http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html + /// Coefficients taken from: http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html ///
- /// Descriptions taken from: - /// http://en.wikipedia.org/wiki/Standard_illuminant + /// Descriptions taken from: http://en.wikipedia.org/wiki/Standard_illuminant ///
public static class Illuminants { diff --git a/src/ImageSharp/ColorSpaces/Rgb.cs b/src/ImageSharp/ColorSpaces/Rgb.cs index cdc9e90ad4..5cb89a2931 100644 --- a/src/ImageSharp/ColorSpaces/Rgb.cs +++ b/src/ImageSharp/ColorSpaces/Rgb.cs @@ -14,14 +14,14 @@ namespace SixLabors.ImageSharp.ColorSpaces /// public readonly struct Rgb : IEquatable { - private static readonly Vector3 Min = Vector3.Zero; - private static readonly Vector3 Max = Vector3.One; - /// - /// The default rgb working space + /// The default rgb working space. /// public static readonly RgbWorkingSpaceBase DefaultWorkingSpace = RgbWorkingSpaces.SRgb; + private static readonly Vector3 Min = Vector3.Zero; + private static readonly Vector3 Max = Vector3.One; + /// /// Gets the red component. /// A value usually ranging between 0 and 1. diff --git a/src/ImageSharp/ColorSpaces/RgbWorkingSpaces.cs b/src/ImageSharp/ColorSpaces/RgbWorkingSpaces.cs index ee3822c152..7ddcae7cea 100644 --- a/src/ImageSharp/ColorSpaces/RgbWorkingSpaces.cs +++ b/src/ImageSharp/ColorSpaces/RgbWorkingSpaces.cs @@ -8,8 +8,7 @@ namespace SixLabors.ImageSharp.ColorSpaces { /// - /// Chromaticity coordinates taken from: - /// + /// Chromaticity coordinates based on: /// public static class RgbWorkingSpaces { diff --git a/src/ImageSharp/Common/Extensions/EnumerableExtensions.cs b/src/ImageSharp/Common/Extensions/EnumerableExtensions.cs index e97a2eaed0..e28db7cff1 100644 --- a/src/ImageSharp/Common/Extensions/EnumerableExtensions.cs +++ b/src/ImageSharp/Common/Extensions/EnumerableExtensions.cs @@ -45,7 +45,7 @@ public static IEnumerable SteppedRange(int fromInclusive, int toExclusive, /// The start index, inclusive. /// /// - /// A method that has one parameter and returns a calculating the end index + /// A method that has one parameter and returns a calculating the end index. /// /// /// The incremental step. @@ -65,7 +65,7 @@ public static IEnumerable SteppedRange(int fromInclusive, Func t /// The start index, inclusive. /// /// - /// A method that has one parameter and returns a calculating the end index + /// A method that has one parameter and returns a calculating the end index. /// /// /// The incremental step. diff --git a/src/ImageSharp/Common/Tuples/Octet.cs b/src/ImageSharp/Common/Tuples/Octet.cs index 23faf08ae9..7ece2ed562 100644 --- a/src/ImageSharp/Common/Tuples/Octet.cs +++ b/src/ImageSharp/Common/Tuples/Octet.cs @@ -12,7 +12,7 @@ namespace SixLabors.ImageSharp.Tuples internal static class Octet { /// - /// Value tuple of -s + /// Value tuple of -s. /// [StructLayout(LayoutKind.Explicit, Size = 8 * sizeof(uint))] public struct OfUInt32 diff --git a/src/ImageSharp/Formats/Bmp/BmpImageFormatDetector.cs b/src/ImageSharp/Formats/Bmp/BmpImageFormatDetector.cs index 6a740d47d1..c0814b1dfc 100644 --- a/src/ImageSharp/Formats/Bmp/BmpImageFormatDetector.cs +++ b/src/ImageSharp/Formats/Bmp/BmpImageFormatDetector.cs @@ -6,7 +6,7 @@ namespace SixLabors.ImageSharp.Formats.Bmp { /// - /// Detects bmp file headers + /// Detects bmp file headers. /// public sealed class BmpImageFormatDetector : IImageFormatDetector { @@ -22,9 +22,9 @@ public IImageFormat DetectFormat(ReadOnlySpan header) private bool IsSupportedFileFormat(ReadOnlySpan header) { // TODO: This should be in constants - return header.Length >= this.HeaderSize && - header[0] == 0x42 && // B - header[1] == 0x4D; // M + return header.Length >= this.HeaderSize + && header[0] == 0x42 // B + && header[1] == 0x4D; // M } } } \ No newline at end of file diff --git a/src/ImageSharp/Formats/Gif/IGifDecoderOptions.cs b/src/ImageSharp/Formats/Gif/IGifDecoderOptions.cs index 42c202a3d9..0c59163cce 100644 --- a/src/ImageSharp/Formats/Gif/IGifDecoderOptions.cs +++ b/src/ImageSharp/Formats/Gif/IGifDecoderOptions.cs @@ -22,7 +22,7 @@ internal interface IGifDecoderOptions Encoding TextEncoding { get; } /// - /// Gets the decoding mode for multi-frame images + /// Gets the decoding mode for multi-frame images. /// FrameDecodingMode DecodingMode { get; } } diff --git a/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Generated.cs b/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Generated.cs index 1f47de594c..a9e9903a9d 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Generated.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Generated.cs @@ -97,7 +97,7 @@ public void NormalizeColorsInplace(float maximum) { Vector4 CMin4 = new Vector4(0F); Vector4 CMax4 = new Vector4(maximum); - Vector4 COff4 = new Vector4((float)Math.Ceiling(maximum/2)); + Vector4 COff4 = new Vector4(MathF.Ceiling(maximum / 2)); this.V0L = Vector4.Clamp(this.V0L + COff4, CMin4, CMax4); this.V0R = Vector4.Clamp(this.V0R + COff4, CMin4, CMax4); @@ -123,7 +123,7 @@ public void NormalizeColorsInplace(float maximum) [MethodImpl(InliningOptions.ShortMethod)] public void NormalizeColorsAndRoundInplaceAvx2(float maximum) { - Vector off = new Vector((float)Math.Ceiling(maximum/2)); + Vector off = new Vector(MathF.Ceiling(maximum / 2)); Vector max = new Vector(maximum); ref Vector row0 = ref Unsafe.As>(ref this.V0L); diff --git a/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Generated.tt b/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Generated.tt index ec4e06e429..d6c42a802a 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Generated.tt +++ b/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Generated.tt @@ -62,7 +62,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components { Vector4 CMin4 = new Vector4(0F); Vector4 CMax4 = new Vector4(maximum); - Vector4 COff4 = new Vector4((float)Math.Ceiling(maximum/2)); + Vector4 COff4 = new Vector4(MathF.Ceiling(maximum / 2)); <# @@ -86,7 +86,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components [MethodImpl(InliningOptions.ShortMethod)] public void NormalizeColorsAndRoundInplaceAvx2(float maximum) { - Vector off = new Vector((float)Math.Ceiling(maximum/2)); + Vector off = new Vector(MathF.Ceiling(maximum / 2)); Vector max = new Vector(maximum); <# diff --git a/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.cs b/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.cs index c0de450695..c85bd725c9 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.cs @@ -147,7 +147,7 @@ public static Block8x8F Load(Span data) } /// - /// Fill the block with defaults (zeroes) + /// Fill the block with defaults (zeroes). /// [MethodImpl(InliningOptions.ShortMethod)] public void Clear() @@ -157,7 +157,7 @@ public void Clear() } /// - /// Load raw 32bit floating point data from source + /// Load raw 32bit floating point data from source. /// /// Source [MethodImpl(InliningOptions.ShortMethod)] @@ -170,7 +170,7 @@ public void LoadFrom(Span source) } /// - /// Load raw 32bit floating point data from source + /// Load raw 32bit floating point data from source. /// /// Block pointer /// Source @@ -197,7 +197,7 @@ public unsafe void LoadFrom(Span source) } /// - /// Copy raw 32bit floating point data to dest + /// Copy raw 32bit floating point data to dest, /// /// Destination [MethodImpl(InliningOptions.ShortMethod)] @@ -210,7 +210,7 @@ public void CopyTo(Span dest) } /// - /// Convert salars to byte-s and copy to dest + /// Convert salars to byte-s and copy to dest, /// /// Pointer to block /// Destination @@ -226,10 +226,10 @@ public static unsafe void CopyTo(Block8x8F* blockPtr, Span dest) } /// - /// Copy raw 32bit floating point data to dest + /// Copy raw 32bit floating point data to dest. /// - /// Block pointer - /// Destination + /// The block pointer. + /// The destination. [MethodImpl(InliningOptions.ShortMethod)] public static unsafe void CopyTo(Block8x8F* blockPtr, Span dest) { @@ -275,7 +275,7 @@ public float[] ToArray() /// /// Multiply all elements of the block. /// - /// The value to multiply by + /// The value to multiply by. [MethodImpl(InliningOptions.ShortMethod)] public void MultiplyInplace(float value) { @@ -298,7 +298,7 @@ public void MultiplyInplace(float value) } /// - /// Multiply all elements of the block by the corresponding elements of 'other' + /// Multiply all elements of the block by the corresponding elements of 'other'. /// [MethodImpl(InliningOptions.ShortMethod)] public void MultiplyInplace(ref Block8x8F other) @@ -349,8 +349,8 @@ public void AddToAllInplace(Vector4 diff) /// /// Quantize the block. /// - /// Block pointer - /// Qt pointer + /// The block pointer. + /// The qt pointer. /// Unzig pointer // [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe void DequantizeBlock(Block8x8F* blockPtr, Block8x8F* qtPtr, byte* unzigPtr) diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/AdobeMarker.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/AdobeMarker.cs index 43de39ac78..e34af98251 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/AdobeMarker.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/AdobeMarker.cs @@ -40,7 +40,7 @@ private AdobeMarker(short dctEncodeVersion, short app14Flags0, short app14Flags1 /// /// Gets the horizontal downsampling hint used for DCT encoding /// 0x0 : (none - Chop) - /// Bit 15 : Encoded with Blend=1 downsampling + /// Bit 15 : Encoded with Blend=1 downsampling. /// public short APP14Flags0 { get; } @@ -63,7 +63,7 @@ private AdobeMarker(short dctEncodeVersion, short app14Flags0, short app14Flags1 /// Converts the specified byte array representation of an Adobe marker to its equivalent and /// returns a value that indicates whether the conversion succeeded. /// - /// The byte array containing metadata to parse + /// The byte array containing metadata to parse. /// The marker to return. public static bool TryParse(byte[] bytes, out AdobeMarker marker) { diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromCmyk.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromCmyk.cs index d4dc31fe0c..a57535b71c 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromCmyk.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromCmyk.cs @@ -8,7 +8,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder.ColorConverters { internal abstract partial class JpegColorConverter { - internal class FromCmyk : JpegColorConverter + internal sealed class FromCmyk : JpegColorConverter { public FromCmyk(int precision) : base(JpegColorSpace.Cmyk, precision) diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromGrayScale.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromGrayScale.cs index 4a5dfa6322..15bb2cf4b4 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromGrayScale.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromGrayScale.cs @@ -10,7 +10,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder.ColorConverters { internal abstract partial class JpegColorConverter { - internal class FromGrayscale : JpegColorConverter + internal sealed class FromGrayscale : JpegColorConverter { public FromGrayscale(int precision) : base(JpegColorSpace.Grayscale, precision) diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromRgb.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromRgb.cs index 516dfb39fe..2f68e312dc 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromRgb.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromRgb.cs @@ -8,7 +8,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder.ColorConverters { internal abstract partial class JpegColorConverter { - internal class FromRgb : JpegColorConverter + internal sealed class FromRgb : JpegColorConverter { public FromRgb(int precision) : base(JpegColorSpace.RGB, precision) diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromYCbCrBasic.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromYCbCrBasic.cs index 124aac1224..a646cd6cfe 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromYCbCrBasic.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromYCbCrBasic.cs @@ -8,7 +8,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder.ColorConverters { internal abstract partial class JpegColorConverter { - internal class FromYCbCrBasic : JpegColorConverter + internal sealed class FromYCbCrBasic : JpegColorConverter { public FromYCbCrBasic(int precision) : base(JpegColorSpace.YCbCr, precision) diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromYCbCrSimd.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromYCbCrSimd.cs index 10ef02a931..1706b4c1bc 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromYCbCrSimd.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromYCbCrSimd.cs @@ -12,7 +12,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder.ColorConverters { internal abstract partial class JpegColorConverter { - internal class FromYCbCrSimd : JpegColorConverter + internal sealed class FromYCbCrSimd : JpegColorConverter { public FromYCbCrSimd(int precision) : base(JpegColorSpace.YCbCr, precision) diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromYCbCrSimdAvx2.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromYCbCrSimdAvx2.cs index 9953f78c18..093ea2f9a2 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromYCbCrSimdAvx2.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromYCbCrSimdAvx2.cs @@ -13,7 +13,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder.ColorConverters { internal abstract partial class JpegColorConverter { - internal class FromYCbCrSimdAvx2 : JpegColorConverter + internal sealed class FromYCbCrSimdAvx2 : JpegColorConverter { public FromYCbCrSimdAvx2(int precision) : base(JpegColorSpace.YCbCr, precision) diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromYccK.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromYccK.cs index 94be11e237..cd8a3bb06c 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromYccK.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.FromYccK.cs @@ -8,7 +8,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder.ColorConverters { internal abstract partial class JpegColorConverter { - internal class FromYccK : JpegColorConverter + internal sealed class FromYccK : JpegColorConverter { public FromYccK(int precision) : base(JpegColorSpace.Ycck, precision) diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.cs index c2e390c590..61e3598696 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/ColorConverters/JpegColorConverter.cs @@ -42,8 +42,8 @@ protected JpegColorConverter(JpegColorSpace colorSpace, int precision) { this.ColorSpace = colorSpace; this.Precision = precision; - this.MaximumValue = (float)Math.Pow(2, precision) - 1; - this.HalfValue = (float)Math.Ceiling(this.MaximumValue / 2); + this.MaximumValue = MathF.Pow(2, precision) - 1; + this.HalfValue = MathF.Ceiling(this.MaximumValue / 2); } /// diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/FastACTable.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/FastACTable.cs index 57d2221ba3..dc78a89ddb 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/FastACTable.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/FastACTable.cs @@ -8,7 +8,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder internal unsafe struct FastACTable { /// - /// Gets the lookahead array + /// Gets the lookahead array. /// public fixed short Lookahead[512]; diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/HuffmanTable.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/HuffmanTable.cs index a2c9bade19..7e025e271e 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/HuffmanTable.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/HuffmanTable.cs @@ -26,22 +26,22 @@ internal unsafe struct HuffmanTable #pragma warning restore IDE0044 // Add readonly modifier /// - /// Gets the max code array + /// Gets the max code array. /// public fixed uint MaxCode[18]; /// - /// Gets the value offset array + /// Gets the value offset array. /// public fixed int ValOffset[18]; /// - /// Gets the huffman value array + /// Gets the huffman value array. /// public fixed byte Values[256]; /// - /// Gets the lookahead array + /// Gets the lookahead array. /// public fixed byte Lookahead[512]; diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/JFifMarker.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/JFifMarker.cs index 76f0e2cb51..5bd5920dbe 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/JFifMarker.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/JFifMarker.cs @@ -7,7 +7,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder { /// - /// Provides information about the JFIF marker segment + /// Provides information about the JFIF marker segment. /// TODO: Thumbnail? /// internal readonly struct JFifMarker : IEquatable @@ -20,11 +20,11 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder /// /// Initializes a new instance of the struct. /// - /// The major version - /// The minor version - /// The units for the density values - /// The horizontal pixel density - /// The vertical pixel density + /// The major version. + /// The minor version. + /// The units for the density values. + /// The horizontal pixel density. + /// The vertical pixel density. private JFifMarker(byte majorVersion, byte minorVersion, byte densityUnits, short xDensity, short yDensity) { if (xDensity <= 0) @@ -47,12 +47,12 @@ private JFifMarker(byte majorVersion, byte minorVersion, byte densityUnits, shor } /// - /// Gets the major version + /// Gets the major version. /// public byte MajorVersion { get; } /// - /// Gets the minor version + /// Gets the minor version. /// public byte MinorVersion { get; } @@ -78,7 +78,7 @@ private JFifMarker(byte majorVersion, byte minorVersion, byte densityUnits, shor /// Converts the specified byte array representation of an JFIF marker to its equivalent and /// returns a value that indicates whether the conversion succeeded. /// - /// The byte array containing metadata to parse + /// The byte array containing metadata to parse. /// The marker to return. public static bool TryParse(byte[] bytes, out JFifMarker marker) { diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegBlockPostProcessor.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegBlockPostProcessor.cs index fe39f41884..c5efb812e0 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegBlockPostProcessor.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegBlockPostProcessor.cs @@ -20,17 +20,17 @@ internal struct JpegBlockPostProcessor public Block8x8F SourceBlock; /// - /// Temporal block 1 to store intermediate and/or final computation results + /// Temporal block 1 to store intermediate and/or final computation results. /// public Block8x8F WorkspaceBlock1; /// - /// Temporal block 2 to store intermediate and/or final computation results + /// Temporal block 2 to store intermediate and/or final computation results. /// public Block8x8F WorkspaceBlock2; /// - /// The quantization table as + /// The quantization table as . /// public Block8x8F DequantiazationTable; @@ -40,9 +40,9 @@ internal struct JpegBlockPostProcessor private Size subSamplingDivisors; /// - /// Defines the maximum value derived from the bitdepth + /// Defines the maximum value derived from the bitdepth. /// - private int maximumValue; + private readonly int maximumValue; /// /// Initializes a new instance of the struct. @@ -54,7 +54,7 @@ public JpegBlockPostProcessor(IRawJpegData decoder, IJpegComponent component) int qtIndex = component.QuantizationTableIndex; this.DequantiazationTable = ZigZag.CreateDequantizationTable(ref decoder.QuantizationTables[qtIndex]); this.subSamplingDivisors = component.SubSamplingDivisors; - this.maximumValue = (int)Math.Pow(2, decoder.Precision) - 1; + this.maximumValue = (int)MathF.Pow(2, decoder.Precision) - 1; this.SourceBlock = default; this.WorkspaceBlock1 = default; @@ -66,7 +66,7 @@ public JpegBlockPostProcessor(IRawJpegData decoder, IJpegComponent component) /// - Dequantize /// - Applying IDCT /// - Level shift by +maximumValue/2, clip to [0, maximumValue] - /// - Copy the resulting color values into 'destArea' scaling up the block by amount defined in + /// - Copy the resulting color values into 'destArea' scaling up the block by amount defined in . /// /// The source block. /// The destination buffer area. diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegColorSpace.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegColorSpace.cs index 2861a2c2e9..aa33744adf 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegColorSpace.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegColorSpace.cs @@ -4,7 +4,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder { /// - /// Identifies the colorspace of a Jpeg image + /// Identifies the colorspace of a Jpeg image. /// internal enum JpegColorSpace { diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegComponent.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegComponent.cs index ac24f4ca58..5353303947 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegComponent.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegComponent.cs @@ -45,7 +45,7 @@ public JpegComponent(MemoryAllocator memoryAllocator, JpegFrame frame, byte id, } /// - /// Gets the component Id. + /// Gets the component id. /// public byte Id { get; } diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegComponentPostProcessor.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegComponentPostProcessor.cs index e7f3e4fda5..e1a9380a03 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegComponentPostProcessor.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegComponentPostProcessor.cs @@ -78,7 +78,7 @@ public void Dispose() public void CopyBlocksToColorBuffer() { var blockPp = new JpegBlockPostProcessor(this.ImagePostProcessor.RawJpeg, this.Component); - float maximumValue = (float)Math.Pow(2, this.ImagePostProcessor.RawJpeg.Precision) - 1; + float maximumValue = MathF.Pow(2, this.ImagePostProcessor.RawJpeg.Precision) - 1; for (int y = 0; y < this.BlockRowsPerStep; y++) { diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegFrame.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegFrame.cs index 33a7c68baf..f426eb1b15 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegFrame.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegFrame.cs @@ -11,68 +11,68 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder internal sealed class JpegFrame : IDisposable { /// - /// Gets or sets a value indicating whether the frame uses the extended specification + /// Gets or sets a value indicating whether the frame uses the extended specification. /// public bool Extended { get; set; } /// - /// Gets or sets a value indicating whether the frame uses the progressive specification + /// Gets or sets a value indicating whether the frame uses the progressive specification. /// public bool Progressive { get; set; } /// - /// Gets or sets the precision + /// Gets or sets the precision. /// public byte Precision { get; set; } /// - /// Gets or sets the number of scanlines within the frame + /// Gets or sets the number of scanlines within the frame. /// public short Scanlines { get; set; } /// - /// Gets or sets the number of samples per scanline + /// Gets or sets the number of samples per scanline. /// public short SamplesPerLine { get; set; } /// - /// Gets or sets the number of components within a frame. In progressive frames this value can range from only 1 to 4 + /// Gets or sets the number of components within a frame. In progressive frames this value can range from only 1 to 4. /// public byte ComponentCount { get; set; } /// - /// Gets or sets the component id collection + /// Gets or sets the component id collection. /// public byte[] ComponentIds { get; set; } /// - /// Gets or sets the order in which to process the components + /// Gets or sets the order in which to process the components. /// in interleaved mode. /// public byte[] ComponentOrder { get; set; } /// - /// Gets or sets the frame component collection + /// Gets or sets the frame component collection. /// public JpegComponent[] Components { get; set; } /// - /// Gets or sets the maximum horizontal sampling factor + /// Gets or sets the maximum horizontal sampling factor. /// public int MaxHorizontalFactor { get; set; } /// - /// Gets or sets the maximum vertical sampling factor + /// Gets or sets the maximum vertical sampling factor. /// public int MaxVerticalFactor { get; set; } /// - /// Gets or sets the number of MCU's per line + /// Gets or sets the number of MCU's per line. /// public int McusPerLine { get; set; } /// - /// Gets or sets the number of MCU's per column + /// Gets or sets the number of MCU's per column. /// public int McusPerColumn { get; set; } @@ -91,7 +91,7 @@ public void Dispose() } /// - /// Allocates the frame component blocks + /// Allocates the frame component blocks. /// public void InitComponents() { diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/ProfileResolver.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/ProfileResolver.cs index 3e7108b151..abfd6f556c 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/ProfileResolver.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/ProfileResolver.cs @@ -12,30 +12,30 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder internal static class ProfileResolver { /// - /// Describes the EXIF specific markers + /// Describes the EXIF specific markers. /// public static readonly byte[] JFifMarker = Encoding.ASCII.GetBytes("JFIF\0"); /// - /// Describes the EXIF specific markers + /// Describes the EXIF specific markers. /// public static readonly byte[] IccMarker = Encoding.ASCII.GetBytes("ICC_PROFILE\0"); /// - /// Describes the ICC specific markers + /// Describes the ICC specific markers. /// public static readonly byte[] ExifMarker = Encoding.ASCII.GetBytes("Exif\0\0"); /// - /// Describes Adobe specific markers + /// Describes Adobe specific markers . /// public static readonly byte[] AdobeMarker = Encoding.ASCII.GetBytes("Adobe"); /// - /// Returns a value indicating whether the passed bytes are a match to the profile identifier + /// Returns a value indicating whether the passed bytes are a match to the profile identifier. /// - /// The bytes to check - /// The profile identifier + /// The bytes to check. + /// The profile identifier. /// The public static bool IsProfile(ReadOnlySpan bytesToCheck, ReadOnlySpan profileIdentifier) { diff --git a/src/ImageSharp/IImageInfo.cs b/src/ImageSharp/IImageInfo.cs index 6e64aa679a..b1b1afc66f 100644 --- a/src/ImageSharp/IImageInfo.cs +++ b/src/ImageSharp/IImageInfo.cs @@ -8,7 +8,7 @@ namespace SixLabors.ImageSharp { /// /// Encapsulates properties that describe basic image information including dimensions, pixel type information - /// and additional metadata + /// and additional metadata. /// public interface IImageInfo { diff --git a/src/ImageSharp/IO/DoubleBufferedStreamReader.cs b/src/ImageSharp/IO/DoubleBufferedStreamReader.cs index 8530ecec52..6d5673d5a4 100644 --- a/src/ImageSharp/IO/DoubleBufferedStreamReader.cs +++ b/src/ImageSharp/IO/DoubleBufferedStreamReader.cs @@ -13,10 +13,10 @@ namespace SixLabors.ImageSharp.IO /// A stream reader that add a secondary level buffer in addition to native stream buffered reading /// to reduce the overhead of small incremental reads. /// - internal class DoubleBufferedStreamReader : IDisposable + internal sealed class DoubleBufferedStreamReader : IDisposable { /// - /// The length, in bytes, of the buffering chunk + /// The length, in bytes, of the buffering chunk. /// public const int ChunkLength = 4096; @@ -49,12 +49,12 @@ public DoubleBufferedStreamReader(MemoryAllocator memoryAllocator, Stream stream } /// - /// Gets the length, in bytes, of the stream + /// Gets the length, in bytes, of the stream. /// public long Length => this.length; /// - /// Gets or sets the current position within the stream + /// Gets or sets the current position within the stream. /// public long Position { diff --git a/src/ImageSharp/IO/Endianness.cs b/src/ImageSharp/IO/Endianness.cs deleted file mode 100644 index 59b2ae77c1..0000000000 --- a/src/ImageSharp/IO/Endianness.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Six Labors and contributors. -// Licensed under the Apache License, Version 2.0. - -namespace SixLabors.ImageSharp.IO -{ - /// - /// Endianness of a converter - /// - internal enum Endianness - { - /// - /// Little endian - least significant byte first - /// - LittleEndian, - - /// - /// Big endian - most significant byte first - /// - BigEndian - } -} diff --git a/src/ImageSharp/IO/LocalFileSystem.cs b/src/ImageSharp/IO/LocalFileSystem.cs index dc5901ff92..11f3d79723 100644 --- a/src/ImageSharp/IO/LocalFileSystem.cs +++ b/src/ImageSharp/IO/LocalFileSystem.cs @@ -8,7 +8,7 @@ namespace SixLabors.ImageSharp.IO /// /// A wrapper around the local File apis. /// - internal class LocalFileSystem : IFileSystem + internal sealed class LocalFileSystem : IFileSystem { /// public Stream OpenRead(string path) => File.OpenRead(path); diff --git a/src/ImageSharp/Image.FromBytes.cs b/src/ImageSharp/Image.FromBytes.cs index 34927e6e2b..7ceeea9498 100644 --- a/src/ImageSharp/Image.FromBytes.cs +++ b/src/ImageSharp/Image.FromBytes.cs @@ -3,7 +3,6 @@ using System; using System.IO; -using System.Linq; using SixLabors.ImageSharp.Formats; using SixLabors.ImageSharp.PixelFormats; @@ -32,7 +31,7 @@ public static IImageFormat DetectFormat(byte[] data) /// The mime type or null if none found. public static IImageFormat DetectFormat(Configuration config, byte[] data) { - using (Stream stream = new MemoryStream(data)) + using (var stream = new MemoryStream(data)) { return DetectFormat(config, stream); } @@ -118,9 +117,9 @@ public static Image Load(byte[] data, out IImageFormat format) public static Image Load(Configuration config, byte[] data) where TPixel : struct, IPixel { - using (var memoryStream = new MemoryStream(data)) + using (var steram = new MemoryStream(data)) { - return Load(config, memoryStream); + return Load(config, steram); } } @@ -135,9 +134,9 @@ public static Image Load(Configuration config, byte[] data) public static Image Load(Configuration config, byte[] data, out IImageFormat format) where TPixel : struct, IPixel { - using (var memoryStream = new MemoryStream(data)) + using (var stream = new MemoryStream(data)) { - return Load(config, memoryStream, out format); + return Load(config, stream, out format); } } @@ -151,9 +150,9 @@ public static Image Load(Configuration config, byte[] data, out public static Image Load(byte[] data, IImageDecoder decoder) where TPixel : struct, IPixel { - using (var memoryStream = new MemoryStream(data)) + using (var stream = new MemoryStream(data)) { - return Load(memoryStream, decoder); + return Load(stream, decoder); } } diff --git a/src/ImageSharp/Image.WrapMemory.cs b/src/ImageSharp/Image.WrapMemory.cs index c2935bed93..4bb24a126b 100644 --- a/src/ImageSharp/Image.WrapMemory.cs +++ b/src/ImageSharp/Image.WrapMemory.cs @@ -7,7 +7,6 @@ using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.MetaData; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.Memory; namespace SixLabors.ImageSharp { @@ -22,10 +21,10 @@ public static partial class Image /// /// The pixel type /// The - /// The pixel memory - /// The width of the memory image - /// The height of the memory image - /// The + /// The pixel memory. + /// The width of the memory image. + /// The height of the memory image. + /// The . /// An instance public static Image WrapMemory( Configuration config, @@ -45,10 +44,10 @@ public static Image WrapMemory( /// /// The pixel type /// The - /// The pixel memory - /// The width of the memory image - /// The height of the memory image - /// An instance + /// The pixel memory. + /// The width of the memory image. + /// The height of the memory image. + /// An instance. public static Image WrapMemory( Configuration config, Memory pixelMemory, @@ -64,11 +63,11 @@ public static Image WrapMemory( /// allowing to view/manipulate it as an ImageSharp instance. /// The memory is being observed, the caller remains responsible for managing it's lifecycle. /// - /// The pixel type - /// The pixel memory - /// The width of the memory image - /// The height of the memory image - /// An instance + /// The pixel type. + /// The pixel memory. + /// The width of the memory image. + /// The height of the memory image. + /// An instance. public static Image WrapMemory( Memory pixelMemory, int width, @@ -88,8 +87,8 @@ public static Image WrapMemory( /// The pixel type /// The /// The that is being transferred to the image - /// The width of the memory image - /// The height of the memory image + /// The width of the memory image. + /// The height of the memory image. /// The /// An instance public static Image WrapMemory( @@ -111,11 +110,11 @@ public static Image WrapMemory( /// meaning that the caller is not allowed to dispose . /// It will be disposed together with the result image. /// - /// The pixel type + /// The pixel type. /// The - /// The that is being transferred to the image - /// The width of the memory image - /// The height of the memory image + /// The that is being transferred to the image. + /// The width of the memory image. + /// The height of the memory image. /// An instance public static Image WrapMemory( Configuration config, @@ -135,10 +134,10 @@ public static Image WrapMemory( /// It will be disposed together with the result image. /// /// The pixel type - /// The that is being transferred to the image - /// The width of the memory image - /// The height of the memory image - /// An instance + /// The that is being transferred to the image. + /// The width of the memory image. + /// The height of the memory image. + /// An instance. public static Image WrapMemory( IMemoryOwner pixelMemoryOwner, int width, diff --git a/src/ImageSharp/ImageExtensions.Internal.cs b/src/ImageSharp/ImageExtensions.Internal.cs index dfdbbd89b8..5b5e566659 100644 --- a/src/ImageSharp/ImageExtensions.Internal.cs +++ b/src/ImageSharp/ImageExtensions.Internal.cs @@ -3,7 +3,6 @@ using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.Memory; namespace SixLabors.ImageSharp { diff --git a/src/ImageSharp/ImageExtensions.cs b/src/ImageSharp/ImageExtensions.cs index cbf93275c8..5010451b8e 100644 --- a/src/ImageSharp/ImageExtensions.cs +++ b/src/ImageSharp/ImageExtensions.cs @@ -12,7 +12,7 @@ namespace SixLabors.ImageSharp { /// - /// Extension methods over Image{TPixel} + /// Extension methods over Image{TPixel}. /// public static partial class ImageExtensions { @@ -33,7 +33,7 @@ public static void Save(this Image source, string filePath) if (format is null) { var sb = new StringBuilder(); - sb.AppendLine($"Can't find a format that is associated with the file extension '{ext}'. Registered formats with there extensions include:"); + sb.AppendLine($"No encoder was found for extension '{ext}'. Registered encoders include:"); foreach (IImageFormat fmt in source.GetConfiguration().ImageFormats) { sb.AppendLine($" - {fmt.Name} : {string.Join(", ", fmt.FileExtensions)}"); @@ -47,7 +47,7 @@ public static void Save(this Image source, string filePath) if (encoder is null) { var sb = new StringBuilder(); - sb.AppendLine($"Can't find encoder for file extension '{ext}' using image format '{format.Name}'. Registered encoders include:"); + sb.AppendLine($"No encoder was found for extension '{ext}' using image format '{format.Name}'. Registered encoders include:"); foreach (KeyValuePair enc in source.GetConfiguration().ImageFormatsManager.ImageEncoders) { sb.AppendLine($" - {enc.Key} : {enc.Value.GetType().Name}"); @@ -94,7 +94,7 @@ public static void Save(this Image source, Stream stream, IImage if (encoder is null) { var sb = new StringBuilder(); - sb.AppendLine("Can't find encoder for provided mime type. Available encoded:"); + sb.AppendLine("No encoder was found for the provided mime type. Registered encoders include:"); foreach (KeyValuePair val in source.GetConfiguration().ImageFormatsManager.ImageEncoders) { diff --git a/src/ImageSharp/Memory/RowInterval.cs b/src/ImageSharp/Memory/RowInterval.cs index 501ed5e69c..835e880e94 100644 --- a/src/ImageSharp/Memory/RowInterval.cs +++ b/src/ImageSharp/Memory/RowInterval.cs @@ -22,24 +22,21 @@ public RowInterval(int min, int max) } /// - /// Gets the INCLUSIVE minimum + /// Gets the INCLUSIVE minimum. /// public int Min { get; } /// - /// Gets the EXCLUSIVE maximum + /// Gets the EXCLUSIVE maximum. /// public int Max { get; } /// - /// Gets the difference ( - ) + /// Gets the difference ( - ). /// public int Height => this.Max - this.Min; /// - public override string ToString() - { - return $"RowInterval [{this.Min}->{this.Max}["; - } + public override string ToString() => $"RowInterval [{this.Min}->{this.Max}]"; } } \ No newline at end of file diff --git a/src/ImageSharp/MetaData/ImageProperty.cs b/src/ImageSharp/MetaData/ImageProperty.cs index 24a3686de2..6d38b6bf13 100644 --- a/src/ImageSharp/MetaData/ImageProperty.cs +++ b/src/ImageSharp/MetaData/ImageProperty.cs @@ -107,10 +107,7 @@ public override bool Equals(object obj) /// /// A containing a fully qualified type name. /// - public override string ToString() - { - return $"ImageProperty [ Name={this.Name}, Value={this.Value} ]"; - } + public override string ToString() => $"ImageProperty [ Name={this.Name}, Value={this.Value} ]"; /// /// Indicates whether the current object is equal to another object of the same type. diff --git a/src/ImageSharp/MetaData/Profiles/Exif/ExifReader.cs b/src/ImageSharp/MetaData/Profiles/Exif/ExifReader.cs index 8ec9eea275..cf95affb04 100644 --- a/src/ImageSharp/MetaData/Profiles/Exif/ExifReader.cs +++ b/src/ImageSharp/MetaData/Profiles/Exif/ExifReader.cs @@ -8,20 +8,19 @@ using System.Linq; using System.Runtime.CompilerServices; using System.Text; -using SixLabors.ImageSharp.IO; using SixLabors.ImageSharp.Primitives; namespace SixLabors.ImageSharp.MetaData.Profiles.Exif { /// - /// Reads and parses EXIF data from a byte array + /// Reads and parses EXIF data from a byte array. /// internal sealed class ExifReader { private List invalidTags; private readonly byte[] exifData; private int position; - private Endianness endianness = Endianness.BigEndian; + private bool isBigEndian; private uint exifOffset; private uint gpsOffset; @@ -38,12 +37,12 @@ public ExifReader(byte[] exifData) public IReadOnlyList InvalidTags => this.invalidTags ?? (IReadOnlyList)Array.Empty(); /// - /// Gets the thumbnail length in the byte stream + /// Gets the thumbnail length in the byte stream. /// public uint ThumbnailLength { get; private set; } /// - /// Gets the thumbnail offset position in the byte stream + /// Gets the thumbnail offset position in the byte stream. /// public uint ThumbnailOffset { get; private set; } @@ -74,10 +73,7 @@ public List ReadValues() var values = new List(); // II == 0x4949 - if (this.ReadUInt16() == 0x4949) - { - this.endianness = Endianness.LittleEndian; - } + this.isBigEndian = !(this.ReadUInt16() == 0x4949); if (this.ReadUInt16() != 0x002A) { @@ -382,7 +378,7 @@ private void AddInvalidTag(ExifTag tag) [MethodImpl(InliningOptions.ShortMethod)] private TEnum ToEnum(int value, TEnum defaultValue) - where TEnum : struct + where TEnum : struct, Enum { if (EnumHelper.IsDefined(value)) { @@ -458,7 +454,7 @@ private double ConvertToDouble(ReadOnlySpan buffer) return default; } - long intValue = this.endianness == Endianness.BigEndian + long intValue = this.isBigEndian ? BinaryPrimitives.ReadInt64BigEndian(buffer) : BinaryPrimitives.ReadInt64LittleEndian(buffer); @@ -473,7 +469,7 @@ private uint ConvertToUInt32(ReadOnlySpan buffer) return default; } - return this.endianness == Endianness.BigEndian + return this.isBigEndian ? BinaryPrimitives.ReadUInt32BigEndian(buffer) : BinaryPrimitives.ReadUInt32LittleEndian(buffer); } @@ -485,7 +481,7 @@ private ushort ConvertToShort(ReadOnlySpan buffer) return default; } - return this.endianness == Endianness.BigEndian + return this.isBigEndian ? BinaryPrimitives.ReadUInt16BigEndian(buffer) : BinaryPrimitives.ReadUInt16LittleEndian(buffer); } @@ -497,7 +493,7 @@ private float ConvertToSingle(ReadOnlySpan buffer) return default; } - int intValue = this.endianness == Endianness.BigEndian + int intValue = this.isBigEndian ? BinaryPrimitives.ReadInt32BigEndian(buffer) : BinaryPrimitives.ReadInt32LittleEndian(buffer); @@ -526,7 +522,7 @@ private int ConvertToInt32(ReadOnlySpan buffer) // SignedLong in Exif Spec return default; } - return this.endianness == Endianness.BigEndian + return this.isBigEndian ? BinaryPrimitives.ReadInt32BigEndian(buffer) : BinaryPrimitives.ReadInt32LittleEndian(buffer); } @@ -551,13 +547,13 @@ private short ConvertToSignedShort(ReadOnlySpan buffer) return default; } - return this.endianness == Endianness.BigEndian + return this.isBigEndian ? BinaryPrimitives.ReadInt16BigEndian(buffer) : BinaryPrimitives.ReadInt16LittleEndian(buffer); } - private class EnumHelper - where TEnum : struct + private sealed class EnumHelper + where TEnum : struct, Enum { private static readonly int[] Values = Enum.GetValues(typeof(TEnum)).Cast() .Select(e => Convert.ToInt32(e)).OrderBy(e => e).ToArray(); diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccColorantTableEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccColorantTableEntry.cs index 8f273dd603..4bcd1b6861 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccColorantTableEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccColorantTableEntry.cs @@ -35,22 +35,22 @@ public IccColorantTableEntry(string name, ushort pcs1, ushort pcs2, ushort pcs3) } /// - /// Gets the colorant name + /// Gets the colorant name. /// public string Name { get; } /// - /// Gets the first PCS value + /// Gets the first PCS value. /// public ushort Pcs1 { get; } /// - /// Gets the second PCS value + /// Gets the second PCS value. /// public ushort Pcs2 { get; } /// - /// Gets the third PCS value + /// Gets the third PCS value. /// public ushort Pcs3 { get; } @@ -110,9 +110,6 @@ public override int GetHashCode() } /// - public override string ToString() - { - return $"{this.Name}: {this.Pcs1}; {this.Pcs2}; {this.Pcs3}"; - } + public override string ToString() => $"{this.Name}: {this.Pcs1}; {this.Pcs2}; {this.Pcs3}"; } } diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccLocalizedString.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccLocalizedString.cs index 00ededca4d..1920e97fe1 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccLocalizedString.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccLocalizedString.cs @@ -49,9 +49,6 @@ public bool Equals(IccLocalizedString other) => this.Text == other.Text; /// - public override string ToString() - { - return $"{this.Culture.Name}: {this.Text}"; - } + public override string ToString() => $"{this.Culture.Name}: {this.Text}"; } } diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileId.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileId.cs index f64d5409ae..710e6bb252 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileId.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileId.cs @@ -31,27 +31,27 @@ public IccProfileId(uint p1, uint p2, uint p3, uint p4) } /// - /// Gets the first part of the ID + /// Gets the first part of the ID. /// public uint Part1 { get; } /// - /// Gets the second part of the ID + /// Gets the second part of the ID. /// public uint Part2 { get; } /// - /// Gets the third part of the ID + /// Gets the third part of the ID. /// public uint Part3 { get; } /// - /// Gets the fourth part of the ID + /// Gets the fourth part of the ID. /// public uint Part4 { get; } /// - /// Gets a value indicating whether the ID is set or just consists of zeros + /// Gets a value indicating whether the ID is set or just consists of zeros. /// public bool IsSet => !this.Equals(Zero); @@ -86,10 +86,7 @@ public IccProfileId(uint p1, uint p2, uint p3, uint p4) } /// - public override bool Equals(object obj) - { - return obj is IccProfileId other && this.Equals(other); - } + public override bool Equals(object obj) => obj is IccProfileId other && this.Equals(other); /// public bool Equals(IccProfileId other) => @@ -109,14 +106,8 @@ public override int GetHashCode() } /// - public override string ToString() - { - return $"{ToHex(this.Part1)}-{ToHex(this.Part2)}-{ToHex(this.Part3)}-{ToHex(this.Part4)}"; - } + public override string ToString() => $"{ToHex(this.Part1)}-{ToHex(this.Part2)}-{ToHex(this.Part3)}-{ToHex(this.Part4)}"; - private static string ToHex(uint value) - { - return value.ToString("X").PadLeft(8, '0'); - } + private static string ToHex(uint value) => value.ToString("X").PadLeft(8, '0'); } } \ No newline at end of file diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccScreeningChannel.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccScreeningChannel.cs index e8885a66bf..7e2072d5bb 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccScreeningChannel.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccScreeningChannel.cs @@ -26,12 +26,12 @@ public IccScreeningChannel(float frequency, float angle, IccScreeningSpotType sp } /// - /// Gets the screen frequency + /// Gets the screen frequency. /// public float Frequency { get; } /// - /// Gets the angle in degrees + /// Gets the angle in degrees. /// public float Angle { get; } @@ -89,9 +89,6 @@ public override int GetHashCode() } /// - public override string ToString() - { - return $"{this.Frequency}Hz; {this.Angle}°; {this.SpotShape}"; - } + public override string ToString() => $"{this.Frequency}Hz; {this.Angle}°; {this.SpotShape}"; } } \ No newline at end of file diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccTagTableEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccTagTableEntry.cs index d93e068c52..7713c4faa1 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccTagTableEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccTagTableEntry.cs @@ -24,17 +24,17 @@ public IccTagTableEntry(IccProfileTag signature, uint offset, uint dataSize) } /// - /// Gets the signature of the tag + /// Gets the signature of the tag. /// public IccProfileTag Signature { get; } /// - /// Gets the offset of entry in bytes + /// Gets the offset of entry in bytes. /// public uint Offset { get; } /// - /// Gets the size of entry in bytes + /// Gets the size of entry in bytes. /// public uint DataSize { get; } @@ -69,10 +69,7 @@ public IccTagTableEntry(IccProfileTag signature, uint offset, uint dataSize) } /// - public override bool Equals(object obj) - { - return obj is IccTagTableEntry other && this.Equals(other); - } + public override bool Equals(object obj) => obj is IccTagTableEntry other && this.Equals(other); /// public bool Equals(IccTagTableEntry other) => @@ -81,15 +78,9 @@ public bool Equals(IccTagTableEntry other) => this.DataSize.Equals(other.DataSize); /// - public override int GetHashCode() - { - return HashCode.Combine(this.Signature, this.Offset, this.DataSize); - } + public override int GetHashCode() => HashCode.Combine(this.Signature, this.Offset, this.DataSize); /// - public override string ToString() - { - return $"{this.Signature} (Offset: {this.Offset}; Size: {this.DataSize})"; - } + public override string ToString() => $"{this.Signature} (Offset: {this.Offset}; Size: {this.DataSize})"; } } diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedByte4.cs b/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedByte4.cs index 82698d5085..8a9368463f 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedByte4.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedByte4.cs @@ -164,10 +164,10 @@ private static uint Pack(ref Vector4 vector) { vector = Vector4.Clamp(vector, MinusOne, Vector4.One) * Half; - uint byte4 = ((uint)Math.Round(vector.X) & 0xFF) << 0; - uint byte3 = ((uint)Math.Round(vector.Y) & 0xFF) << 8; - uint byte2 = ((uint)Math.Round(vector.Z) & 0xFF) << 16; - uint byte1 = ((uint)Math.Round(vector.W) & 0xFF) << 24; + uint byte4 = ((uint)MathF.Round(vector.X) & 0xFF) << 0; + uint byte3 = ((uint)MathF.Round(vector.Y) & 0xFF) << 8; + uint byte2 = ((uint)MathF.Round(vector.Z) & 0xFF) << 16; + uint byte1 = ((uint)MathF.Round(vector.W) & 0xFF) << 24; return byte4 | byte3 | byte2 | byte1; } diff --git a/src/ImageSharp/Primitives/LongRational.cs b/src/ImageSharp/Primitives/LongRational.cs index d790b110d0..b15aa4022f 100644 --- a/src/ImageSharp/Primitives/LongRational.cs +++ b/src/ImageSharp/Primitives/LongRational.cs @@ -8,7 +8,7 @@ namespace SixLabors.ImageSharp.Primitives { /// - /// Represents a number that can be expressed as a fraction + /// Represents a number that can be expressed as a fraction. /// /// /// This is a very simplified implementation of a rational number designed for use with metadata only. diff --git a/src/ImageSharp/Primitives/ValueSize.cs b/src/ImageSharp/Primitives/ValueSize.cs index e5e086540d..44bee50309 100644 --- a/src/ImageSharp/Primitives/ValueSize.cs +++ b/src/ImageSharp/Primitives/ValueSize.cs @@ -28,22 +28,22 @@ public ValueSize(float value, ValueSizeType type) } /// - /// Enumerates the different value types + /// Enumerates the different value types. /// public enum ValueSizeType { /// - /// The value is the final return value + /// The value is the final return value. /// Absolute, /// - /// The value is a percentage of the image width + /// The value is a percentage of the image width. /// PercentageOfWidth, /// - /// The value is a percentage of the images height + /// The value is a percentage of the images height. /// PercentageOfHeight } @@ -59,11 +59,10 @@ public enum ValueSizeType public ValueSizeType Type { get; } /// - /// Implicitly converts a float into an absolute value + /// Implicitly converts a float into an absolute value. /// /// the value to use as the absolute figure. - public static implicit operator ValueSize(float f) - => Absolute(f); + public static implicit operator ValueSize(float f) => Absolute(f); /// /// Create a new ValueSize with as a PercentageOfWidth type with value set to percentage. @@ -89,7 +88,7 @@ public static ValueSize PercentageOfHeight(float percentage) /// Create a new ValueSize with as a Absolute type with value set to value. /// /// The value. - /// a Values size with type Absolute( + /// a Values size with type Absolute. public static ValueSize Absolute(float value) { return new ValueSize(value, ValueSizeType.Absolute); @@ -99,7 +98,7 @@ public static ValueSize Absolute(float value) /// Calculates the specified size. /// /// The size. - /// The calculated value + /// The calculated value. public float Calculate(Size size) { switch (this.Type) @@ -115,10 +114,7 @@ public float Calculate(Size size) } /// - public override string ToString() - { - return $"{this.Value} - {this.Type}"; - } + public override string ToString() => $"{this.Value} - {this.Type}"; /// public override bool Equals(object obj)