From aac8eae64aab06ecd8aa0210e49fb0ba67e9a4ea Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Sat, 10 Aug 2019 23:06:25 +1000 Subject: [PATCH] fix some spelling (#962) --- .../GifNetscapeLoopingApplicationExtension.cs | 4 +-- .../Memory/MemoryOwnerExtensions.cs | 4 +-- .../PixelFormats/PixelAlphaCompositionMode.cs | 4 +-- src/ImageSharp/Primitives/Complex64.cs | 8 ++--- ...alizationSlidingWindowProcessor{TPixel}.cs | 18 +++++------ .../Processors/Transforms/TransformUtils.cs | 6 ++-- .../BlockOperations/Block8x8F_DivideRound.cs | 14 ++++---- .../Codecs/MultiImageBenchmarkBase.cs | 6 ++-- .../ImageSharp.Benchmarks/Color/RgbToYCbCr.cs | 4 +-- .../General/BasicMath/ClampInt32IntoByte.cs | 6 ++-- .../General/CopyBuffers.cs | 22 ++++++------- .../General/Vectorization/UInt32ToSingle.cs | 6 ++-- tests/ImageSharp.Benchmarks/Samplers/Glow.cs | 6 ++-- .../Formats/Bmp/BmpDecoderTests.cs | 4 +-- .../Formats/ImageFormatManagerTests.cs | 4 +-- .../Formats/Jpg/JpegDecoderTests.MetaData.cs | 4 +-- .../Formats/Jpg/JpegDecoderTests.cs | 6 ++-- .../Formats/Jpg/ParseStreamTests.cs | 6 ++-- ...ceImplementations.LLM_FloatingPoint_DCT.cs | 4 +-- .../Jpg/Utils/ReferenceImplementations.cs | 6 ++-- .../Formats/Png/PngSmokeTests.cs | 10 +++--- tests/ImageSharp.Tests/GlobalSuppressions.cs | 6 ++-- .../ImageFrameCollectionTests.Generic.cs | 18 +++++------ .../ImageFrameCollectionTests.NonGeneric.cs | 2 +- .../ImageSharp.Tests/Image/ImageTests.Save.cs | 8 ++--- tests/ImageSharp.Tests/ImageOperationTests.cs | 8 ++--- .../IccDataWriter.PrimitivesTests.cs | 4 +-- .../Numerics/SignedRationalTests.cs | 6 ++-- .../PixelBlenders/PorterDuffFunctionsTests.cs | 8 ++--- .../PorterDuffFunctionsTests_TPixel.cs | 16 +++++----- .../PixelFormats/Rgba32Tests.cs | 6 ++-- .../PixelFormats/RgbaVectorTests.cs | 6 ++-- .../Processors/Transforms/ResizeTests.cs | 32 +++++++++---------- .../Transforms/ProjectiveTransformTests.cs | 6 ++-- .../Quantization/QuantizedImageTests.cs | 10 +++--- tests/ImageSharp.Tests/TestFormat.cs | 4 +-- .../TestUtilities/ArrayHelper.cs | 14 ++++---- .../Attributes/ImageDataAttributeBase.cs | 14 ++++---- .../ImageComparison/ExactImageComparer.cs | 4 +-- .../ImageComparison/TolerantImageComparer.cs | 10 +++--- .../ImageProviders/TestImageProvider.cs | 12 +++---- .../ImageProviders/TestPatternProvider.cs | 8 ++--- .../TestUtilities/MeasureFixture.cs | 6 ++-- .../TestUtilities/TestImageExtensions.cs | 12 +++---- 44 files changed, 186 insertions(+), 186 deletions(-) diff --git a/src/ImageSharp/Formats/Gif/Sections/GifNetscapeLoopingApplicationExtension.cs b/src/ImageSharp/Formats/Gif/Sections/GifNetscapeLoopingApplicationExtension.cs index 49a52edf6a..8af5b81c20 100644 --- a/src/ImageSharp/Formats/Gif/Sections/GifNetscapeLoopingApplicationExtension.cs +++ b/src/ImageSharp/Formats/Gif/Sections/GifNetscapeLoopingApplicationExtension.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using System; @@ -33,7 +33,7 @@ public int WriteTo(Span buffer) // Application Data ---- buffer[12] = 3; // Application block length (always 3) - buffer[13] = 1; // Data sub-block indentity (always 1) + buffer[13] = 1; // Data sub-block identity (always 1) // 0 means loop indefinitely. Count is set as play n + 1 times. BinaryPrimitives.WriteUInt16LittleEndian(buffer.Slice(14, 2), this.RepeatCount); diff --git a/src/ImageSharp/Memory/MemoryOwnerExtensions.cs b/src/ImageSharp/Memory/MemoryOwnerExtensions.cs index 9b68f52c4d..d82e3aaee7 100644 --- a/src/ImageSharp/Memory/MemoryOwnerExtensions.cs +++ b/src/ImageSharp/Memory/MemoryOwnerExtensions.cs @@ -22,7 +22,7 @@ public static int Length(this IMemoryOwner buffer) => buffer.GetSpan().Length; /// - /// Gets a to an offseted position inside the buffer. + /// Gets a to an offsetted position inside the buffer. /// /// The buffer /// The start @@ -60,4 +60,4 @@ public static ref T GetReference(this IMemoryOwner buffer) where T : struct => ref MemoryMarshal.GetReference(buffer.GetSpan()); } -} \ No newline at end of file +} diff --git a/src/ImageSharp/PixelFormats/PixelAlphaCompositionMode.cs b/src/ImageSharp/PixelFormats/PixelAlphaCompositionMode.cs index 0d182d3c24..62dc0fcf59 100644 --- a/src/ImageSharp/PixelFormats/PixelAlphaCompositionMode.cs +++ b/src/ImageSharp/PixelFormats/PixelAlphaCompositionMode.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. namespace SixLabors.ImageSharp.PixelFormats @@ -39,7 +39,7 @@ public enum PixelAlphaCompositionMode Dest, /// - /// The source where they don't overlap othersie dest in overlapping parts. + /// The source where they don't overlap otherwise dest in overlapping parts. /// DestAtop, diff --git a/src/ImageSharp/Primitives/Complex64.cs b/src/ImageSharp/Primitives/Complex64.cs index 75905a9bd7..96883229c4 100644 --- a/src/ImageSharp/Primitives/Complex64.cs +++ b/src/ImageSharp/Primitives/Complex64.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using System; @@ -37,7 +37,7 @@ public Complex64(float real, float imaginary) } /// - /// Performs the multiplication operation between a intance and a scalar. + /// Performs the multiplication operation between a instance and a scalar. /// /// The value to multiply. /// The scalar to use to multiply the value. @@ -46,7 +46,7 @@ public Complex64(float real, float imaginary) public static Complex64 operator *(Complex64 value, float scalar) => new Complex64(value.Real * scalar, value.Imaginary * scalar); /// - /// Performs the multiplication operation between a intance and a . + /// Performs the multiplication operation between a instance and a . /// /// The value to multiply. /// The instance to use to multiply the value. @@ -58,7 +58,7 @@ public Complex64(float real, float imaginary) } /// - /// Performs the multiplication operation between a intance and a . + /// Performs the multiplication operation between a instance and a . /// /// The value to multiply. /// The instance to use to multiply the value. diff --git a/src/ImageSharp/Processing/Processors/Normalization/AdaptiveHistogramEqualizationSlidingWindowProcessor{TPixel}.cs b/src/ImageSharp/Processing/Processors/Normalization/AdaptiveHistogramEqualizationSlidingWindowProcessor{TPixel}.cs index 40e2d41d9b..947268750c 100644 --- a/src/ImageSharp/Processing/Processors/Normalization/AdaptiveHistogramEqualizationSlidingWindowProcessor{TPixel}.cs +++ b/src/ImageSharp/Processing/Processors/Normalization/AdaptiveHistogramEqualizationSlidingWindowProcessor{TPixel}.cs @@ -55,10 +55,10 @@ protected override void OnFrameApply(ImageFrame source, Rectangle source var parallelOptions = new ParallelOptions() { MaxDegreeOfParallelism = configuration.MaxDegreeOfParallelism }; int tileWidth = source.Width / this.Tiles; int tileHeight = tileWidth; - int pixeInTile = tileWidth * tileHeight; + int pixelInTile = tileWidth * tileHeight; int halfTileHeight = tileHeight / 2; int halfTileWidth = halfTileHeight; - var slidingWindowInfos = new SlidingWindowInfos(tileWidth, tileHeight, halfTileWidth, halfTileHeight, pixeInTile); + var slidingWindowInfos = new SlidingWindowInfos(tileWidth, tileHeight, halfTileWidth, halfTileHeight, pixelInTile); using (Buffer2D targetPixels = configuration.MemoryAllocator.Allocate2D(source.Width, source.Height)) { @@ -149,7 +149,7 @@ protected override void OnFrameApply(ImageFrame source, Rectangle source /// The source image. /// The memory allocator. /// The target pixels. - /// Informations about the sliding window dimensions. + /// about the sliding window dimensions. /// The y start position. /// The y end position. /// if set to true the borders of the image will not be checked. @@ -204,7 +204,7 @@ private Action ProcessSlidingWindow( { // Clipping the histogram, but doing it on a copy to keep the original un-clipped values for the next iteration. histogram.CopyTo(histogramCopy); - this.ClipHistogram(histogramCopy, this.ClipLimitPercentage, swInfos.PixeInTile); + this.ClipHistogram(histogramCopy, this.ClipLimitPercentage, swInfos.PixelInTile); } // Calculate the cumulative distribution function, which will map each input pixel in the current tile to a new value. @@ -212,7 +212,7 @@ private Action ProcessSlidingWindow( ? this.CalculateCdf(ref cdfBase, ref histogramCopyBase, histogram.Length - 1) : this.CalculateCdf(ref cdfBase, ref histogramBase, histogram.Length - 1); - float numberOfPixelsMinusCdfMin = swInfos.PixeInTile - cdfMin; + float numberOfPixelsMinusCdfMin = swInfos.PixelInTile - cdfMin; // Map the current pixel to the new equalized value. int luminance = GetLuminance(source[x, y], this.LuminanceLevels); @@ -367,24 +367,24 @@ private void RemovePixelsFromHistogram(ref Vector4 greyValuesBase, ref int histo private class SlidingWindowInfos { - public SlidingWindowInfos(int tileWidth, int tileHeight, int halfTileWidth, int halfTileHeight, int pixeInTile) + public SlidingWindowInfos(int tileWidth, int tileHeight, int halfTileWidth, int halfTileHeight, int pixelInTile) { this.TileWidth = tileWidth; this.TileHeight = tileHeight; this.HalfTileWidth = halfTileWidth; this.HalfTileHeight = halfTileHeight; - this.PixeInTile = pixeInTile; + this.PixelInTile = pixelInTile; } public int TileWidth { get; private set; } public int TileHeight { get; private set; } - public int PixeInTile { get; private set; } + public int PixelInTile { get; private set; } public int HalfTileWidth { get; private set; } public int HalfTileHeight { get; private set; } } } -} \ No newline at end of file +} diff --git a/src/ImageSharp/Processing/Processors/Transforms/TransformUtils.cs b/src/ImageSharp/Processing/Processors/Transforms/TransformUtils.cs index 0ec8c83939..794645550e 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/TransformUtils.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/TransformUtils.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using System; @@ -111,7 +111,7 @@ public static Matrix4x4 CreateTaperMatrix(Size size, TaperSide side, TaperCorner Matrix4x4 matrix = Matrix4x4.Identity; /* - * SkMatrix is layed out in the following manner: + * SkMatrix is laid out in the following manner: * * [ ScaleX SkewY Persp0 ] * [ SkewX ScaleY Persp1 ] @@ -329,7 +329,7 @@ private static Size ConstrainSize(Rectangle rectangle) int width = rectangle.Left < 0 ? rectangle.Right : Math.Max(rectangle.Width, rectangle.Right); // If location in either direction is translated to a negative value equal to or exceeding the - // dimensions in eith direction we need to reassign the dimension. + // dimensions in either direction we need to reassign the dimension. if (height <= 0) { height = rectangle.Height; diff --git a/tests/ImageSharp.Benchmarks/Codecs/Jpeg/BlockOperations/Block8x8F_DivideRound.cs b/tests/ImageSharp.Benchmarks/Codecs/Jpeg/BlockOperations/Block8x8F_DivideRound.cs index 5502475d43..15a3c7eb7d 100644 --- a/tests/ImageSharp.Benchmarks/Codecs/Jpeg/BlockOperations/Block8x8F_DivideRound.cs +++ b/tests/ImageSharp.Benchmarks/Codecs/Jpeg/BlockOperations/Block8x8F_DivideRound.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using System.Numerics; @@ -25,7 +25,7 @@ public unsafe class Block8x8F_DivideRound private static readonly Vector4 Half = new Vector4(0.5f); private Block8x8F inputDividend; - private Block8x8F inputDivisior; + private Block8x8F inputDivisor; [GlobalSetup] public void Setup() @@ -33,7 +33,7 @@ public void Setup() for (int i = 0; i < Block8x8F.Size; i++) { this.inputDividend[i] = i*44.8f; - this.inputDivisior[i] = 100 - i; + this.inputDivisor[i] = 100 - i; } } @@ -43,7 +43,7 @@ public int ByRationalIntegers() int sum = 0; Block8x8F b1 = this.inputDividend; - Block8x8F b2 = this.inputDivisior; + Block8x8F b2 = this.inputDivisor; float* pDividend = (float*)&b1; float* pDivisor = (float*)&b2; @@ -73,7 +73,7 @@ public int BySystemMathRound() int sum = 0; Block8x8F b1 = this.inputDividend; - Block8x8F b2 = this.inputDivisior; + Block8x8F b2 = this.inputDivisor; float* pDividend = (float*)&b1; float* pDivisor = (float*)&b2; @@ -99,7 +99,7 @@ public int BySimdMagic() int sum = 0; Block8x8F bDividend = this.inputDividend; - Block8x8F bDivisor = this.inputDivisior; + Block8x8F bDivisor = this.inputDivisor; float* pDividend = (float*)&bDividend; for (int cnt = 0; cnt < ExecutionCount; cnt++) @@ -155,4 +155,4 @@ private static int RationalRound(int dividend, int divisor) return -((-dividend + (divisor >> 1)) / divisor); } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Benchmarks/Codecs/MultiImageBenchmarkBase.cs b/tests/ImageSharp.Benchmarks/Codecs/MultiImageBenchmarkBase.cs index 84e2d06167..bf694211de 100644 --- a/tests/ImageSharp.Benchmarks/Codecs/MultiImageBenchmarkBase.cs +++ b/tests/ImageSharp.Benchmarks/Codecs/MultiImageBenchmarkBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using BenchmarkDotNet.Configs; @@ -143,7 +143,7 @@ protected virtual void ReadFilesImpl() } /// - /// Execute code for each image stream. If the returned object of the opearation is it will be disposed. + /// Execute code for each image stream. If the returned object of the operation is it will be disposed. /// /// The operation to execute. If the returned object is <see cref="IDisposable"/> it will be disposed protected void ForEachStream(Func operation) @@ -271,4 +271,4 @@ protected void ForEachSystemDrawingImage(Func - /// This should perform better. Coreclr emmitted Vector.Dot() code lacks the vectorization even with IsHardwareAccelerated == true. + /// This should perform better. Coreclr emitted Vector.Dot() code lacks the vectorization even with IsHardwareAccelerated == true. /// Kept this benchmark because maybe it will be improved in a future CLR release. /// /// https://www.gamedev.net/topic/673396-c-systemnumericsvectors-slow/ diff --git a/tests/ImageSharp.Benchmarks/General/BasicMath/ClampInt32IntoByte.cs b/tests/ImageSharp.Benchmarks/General/BasicMath/ClampInt32IntoByte.cs index a8686fc187..c01d988ee3 100644 --- a/tests/ImageSharp.Benchmarks/General/BasicMath/ClampInt32IntoByte.cs +++ b/tests/ImageSharp.Benchmarks/General/BasicMath/ClampInt32IntoByte.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using System; @@ -76,8 +76,8 @@ public byte ClampNoMathsEqualsNoTernary() public byte ClampBitwise() { int x = this.Value; - int absmax = byte.MaxValue - x; - x = (x + byte.MaxValue - AbsBitwiseVer(ref absmax)) >> 1; + int absMax = byte.MaxValue - x; + x = (x + byte.MaxValue - AbsBitwiseVer(ref absMax)) >> 1; x = (x + byte.MinValue + AbsBitwiseVer(ref x)) >> 1; return (byte)x; diff --git a/tests/ImageSharp.Benchmarks/General/CopyBuffers.cs b/tests/ImageSharp.Benchmarks/General/CopyBuffers.cs index 32f1d10c79..6af466e42c 100644 --- a/tests/ImageSharp.Benchmarks/General/CopyBuffers.cs +++ b/tests/ImageSharp.Benchmarks/General/CopyBuffers.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using System; @@ -33,8 +33,8 @@ public class CopyBuffers [Params(10, 50, 100, 1000, 10000)] public int Count { get; set; } - - + + [GlobalSetup] public void Setup() { @@ -93,7 +93,7 @@ public unsafe void UnsafeCopyBlockReferences() { Unsafe.CopyBlock(ref this.destArray[0], ref this.sourceArray[0], (uint)this.Count); } - + [Benchmark(Description = "Unsafe.CopyBlock(ptr)")] public unsafe void UnsafeCopyBlockPointers() { @@ -101,13 +101,13 @@ public unsafe void UnsafeCopyBlockPointers() void* pinnedSource = this.sourceHandle.Pointer; Unsafe.CopyBlock(pinnedDestination, pinnedSource, (uint)this.Count); } - + [Benchmark(Description = "Unsafe.CopyBlockUnaligned(ref)")] public unsafe void UnsafeCopyBlockUnalignedReferences() { Unsafe.CopyBlockUnaligned(ref this.destArray[0], ref this.sourceArray[0], (uint)this.Count); } - + [Benchmark(Description = "Unsafe.CopyBlockUnaligned(ptr)")] public unsafe void UnsafeCopyBlockUnalignedPointers() { @@ -115,7 +115,7 @@ public unsafe void UnsafeCopyBlockUnalignedPointers() void* pinnedSource = this.sourceHandle.Pointer; Unsafe.CopyBlockUnaligned(pinnedDestination, pinnedSource, (uint)this.Count); } - + // BenchmarkDotNet=v0.11.3, OS=Windows 10.0.17134.706 (1803/April2018Update/Redstone4) // Intel Core i7-7700HQ CPU 2.80GHz (Kaby Lake), 1 CPU, 8 logical and 4 physical cores // Frequency=2742189 Hz, Resolution=364.6722 ns, Timer=TSC @@ -123,9 +123,9 @@ public unsafe void UnsafeCopyBlockUnalignedPointers() // [Host] : .NET Core 2.1.9 (CoreCLR 4.6.27414.06, CoreFX 4.6.27415.01), 64bit RyuJIT // Clr : .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3394.0 // Core : .NET Core 2.1.9 (CoreCLR 4.6.27414.06, CoreFX 4.6.27415.01), 64bit RyuJIT - // - // IterationCount=3 LaunchCount=1 WarmupCount=3 - // + // + // IterationCount=3 LaunchCount=1 WarmupCount=3 + // // | Method | Job | Runtime | Count | Mean | Error | StdDev | Ratio | RatioSD | Gen 0 | Gen 1 | Gen 2 | Allocated | // |------------------------------- |----- |-------- |------ |-----------:|-----------:|----------:|------:|--------:|------:|------:|------:|----------:| // | Array.Copy() | Clr | Clr | 10 | 23.636 ns | 2.5299 ns | 0.1387 ns | 1.00 | 0.00 | - | - | - | - | @@ -228,4 +228,4 @@ public unsafe void UnsafeCopyBlockUnalignedPointers() // | Unsafe.CopyBlockUnaligned(ref) | Core | Core | 10000 | 187.489 ns | 13.1527 ns | 0.7209 ns | 0.92 | 0.00 | - | - | - | - | // | Unsafe.CopyBlockUnaligned(ptr) | Core | Core | 10000 | 186.586 ns | 4.6274 ns | 0.2536 ns | 0.91 | 0.00 | - | - | - | - | } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Benchmarks/General/Vectorization/UInt32ToSingle.cs b/tests/ImageSharp.Benchmarks/General/Vectorization/UInt32ToSingle.cs index ca85a350cc..d7ffb332d8 100644 --- a/tests/ImageSharp.Benchmarks/General/Vectorization/UInt32ToSingle.cs +++ b/tests/ImageSharp.Benchmarks/General/Vectorization/UInt32ToSingle.cs @@ -1,4 +1,4 @@ -using System.Numerics; +using System.Numerics; using System.Runtime.CompilerServices; using BenchmarkDotNet.Attributes; @@ -27,7 +27,7 @@ public void MagicMethod() var bVec = new Vector(256.0f / 255.0f); var magicFloat = new Vector(32768.0f); - var magicInt = new Vector(1191182336); // reinterpreded value of 32768.0f + var magicInt = new Vector(1191182336); // reinterpreted value of 32768.0f var mask = new Vector(255); for (int i = 0; i < n; i++) @@ -110,4 +110,4 @@ public void StandardSimdFromInt_RefCast() } } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Benchmarks/Samplers/Glow.cs b/tests/ImageSharp.Benchmarks/Samplers/Glow.cs index 263ce6a7e4..28cb047356 100644 --- a/tests/ImageSharp.Benchmarks/Samplers/Glow.cs +++ b/tests/ImageSharp.Benchmarks/Samplers/Glow.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using System; @@ -144,7 +144,7 @@ public static Vector4 PremultipliedLerp(Vector4 backdrop, Vector4 source, float { amount = amount.Clamp(0, 1); - // Santize on zero alpha + // Sanitize on zero alpha if (Math.Abs(backdrop.W) < Constants.Epsilon) { source.W *= amount; @@ -173,4 +173,4 @@ public static Vector4 PremultipliedLerp(Vector4 backdrop, Vector4 source, float } } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/Formats/Bmp/BmpDecoderTests.cs b/tests/ImageSharp.Tests/Formats/Bmp/BmpDecoderTests.cs index dadce92d13..a2623ce171 100644 --- a/tests/ImageSharp.Tests/Formats/Bmp/BmpDecoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Bmp/BmpDecoderTests.cs @@ -283,8 +283,8 @@ public void BmpDecoder_CanDecodeBitfields_WithUnusualBitmasks(TestImageP // seems to be wrong. This bitmap has an alpha channel of two bits. In many cases this alpha channel has a value of 3, // which should be remapped to 255 for RGBA32, but the magick decoder has a value of 191 set. // The total difference without the alpha channel is still: 0.0204% - // Exporting the image as PNG with GIMP yields to the same result as the imagesharp implementation. - image.CompareToOriginal(provider, ImageComparer.TolerantPercentage(6.1f), new MagickReferenceDecoder()); + // Exporting the image as PNG with GIMP yields to the same result as the ImageSharp implementation. + image.CompareToOriginal(provider, ImageComparer.TolerantPercentage(6.1f), new MagickReferenceDecoder()); } } diff --git a/tests/ImageSharp.Tests/Formats/ImageFormatManagerTests.cs b/tests/ImageSharp.Tests/Formats/ImageFormatManagerTests.cs index 8628d054a0..9a15e1c1b3 100644 --- a/tests/ImageSharp.Tests/Formats/ImageFormatManagerTests.cs +++ b/tests/ImageSharp.Tests/Formats/ImageFormatManagerTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using System; @@ -42,7 +42,7 @@ public void IfAutoloadWellKnownFormatsIsTrueAllFormatsAreLoaded() } [Fact] - public void AddImageFormatDetectorNullthrows() + public void AddImageFormatDetectorNullThrows() { Assert.Throws(() => { diff --git a/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.MetaData.cs b/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.MetaData.cs index 308cf28b35..8d8d316935 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.MetaData.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.MetaData.cs @@ -19,7 +19,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg public partial class JpegDecoderTests { - // TODO: A JPEGsnoop & metadata expert should review if the Exif/Icc expectations are correct. + // TODO: A JPEGsnoop & metadata expert should review if the Exif/Icc expectations are correct. // I'm seeing several entries with Exif-related names in images where we do not decode an exif profile. (- Anton) public static readonly TheoryData MetaDataTestData = new TheoryData @@ -257,4 +257,4 @@ public void Decoder_Reads_Correct_Resolution_From_Exif(bool useIdentify) }); } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs index e316fe67eb..36a160e59a 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs @@ -93,7 +93,7 @@ public void JpegDecoder_IsNotBoundToSinglePixelType(TestImageProvider image = provider.GetImage(JpegDecoder)) @@ -125,7 +125,7 @@ private string GetDifferenceInPercentageString(Image image, Test return "0%"; } - + // DEBUG ONLY! // The PDF.js output should be saved by "tests\ImageSharp.Tests\Formats\Jpg\pdfjs\jpeg-converter.htm" // into "\tests\Images\ActualOutput\JpegDecoderTests\" @@ -158,4 +158,4 @@ public void ValidateProgressivePdfJsOutput(TestImageProvider pro } } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/Formats/Jpg/ParseStreamTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/ParseStreamTests.cs index 3657110c6c..f4f3b83b46 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/ParseStreamTests.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/ParseStreamTests.cs @@ -30,11 +30,11 @@ public ParseStreamTests(ITestOutputHelper output) [InlineData(TestImages.Jpeg.Baseline.Cmyk, JpegColorSpace.Cmyk)] public void ColorSpace_IsDeducedCorrectly(string imageFile, object expectedColorSpaceValue) { - var expecteColorSpace = (JpegColorSpace)expectedColorSpaceValue; + var expectedColorSpace = (JpegColorSpace)expectedColorSpaceValue; using (JpegDecoderCore decoder = JpegFixture.ParseJpegStream(imageFile)) { - Assert.Equal(expecteColorSpace, decoder.ColorSpace); + Assert.Equal(expectedColorSpace, decoder.ColorSpace); } } @@ -131,4 +131,4 @@ public void ComponentScalingIsCorrect_MultiChannelJpeg( } } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/Formats/Jpg/Utils/ReferenceImplementations.LLM_FloatingPoint_DCT.cs b/tests/ImageSharp.Tests/Formats/Jpg/Utils/ReferenceImplementations.LLM_FloatingPoint_DCT.cs index e0e94cb313..46b9b4366f 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/Utils/ReferenceImplementations.LLM_FloatingPoint_DCT.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/Utils/ReferenceImplementations.LLM_FloatingPoint_DCT.cs @@ -131,7 +131,7 @@ private static void iDCT1Dllm_32f(Span y, Span x) /// /// Original: https://github.com/norishigefukushima/dct_simd/blob/master/dct/dct8x8_simd.cpp#L239 - /// Applyies IDCT transformation on "s" copying transformed values to "d", using temporary block "temp" + /// Applies IDCT transformation on "s" copying transformed values to "d", using temporary block "temp" /// /// /// @@ -554,4 +554,4 @@ internal static void fDCT2D_llm( } } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/Formats/Jpg/Utils/ReferenceImplementations.cs b/tests/ImageSharp.Tests/Formats/Jpg/Utils/ReferenceImplementations.cs index 3892770d81..527cc3feda 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/Utils/ReferenceImplementations.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/Utils/ReferenceImplementations.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. // ReSharper disable InconsistentNaming @@ -11,7 +11,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg.Utils { /// - /// This class contains simplified (unefficient) reference implementations to produce verification data for unit tests + /// This class contains simplified (inefficient) reference implementations to produce verification data for unit tests /// Floating point DCT code Ported from https://github.com/norishigefukushima/dct_simd /// internal static partial class ReferenceImplementations @@ -144,4 +144,4 @@ private static int RationalRound(int dividend, int divisor) return -((-dividend + (divisor >> 1)) / divisor); } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/Formats/Png/PngSmokeTests.cs b/tests/ImageSharp.Tests/Formats/Png/PngSmokeTests.cs index b1408247cf..e26aaf8e65 100644 --- a/tests/ImageSharp.Tests/Formats/Png/PngSmokeTests.cs +++ b/tests/ImageSharp.Tests/Formats/Png/PngSmokeTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using System.IO; @@ -18,7 +18,7 @@ public class PngSmokeTests public void GeneralTest(TestImageProvider provider) where TPixel : struct, IPixel { - // does saving a file then repoening mean both files are identical??? + // does saving a file then reopening mean both files are identical??? using (Image image = provider.GetImage()) using (MemoryStream ms = new MemoryStream()) { @@ -41,7 +41,7 @@ public void GeneralTest(TestImageProvider provider) //public void CanSaveIndexedPng(TestImageProvider provider) // where TPixel : struct, IPixel //{ - // // does saving a file then repoening mean both files are identical??? + // // does saving a file then reopening mean both files are identical??? // using (Image image = provider.GetImage()) // using (MemoryStream ms = new MemoryStream()) // { @@ -61,7 +61,7 @@ public void GeneralTest(TestImageProvider provider) //public void CanSaveIndexedPngTwice(TestImageProvider provider) // where TPixel : struct, IPixel //{ - // // does saving a file then repoening mean both files are identical??? + // // does saving a file then reopening mean both files are identical??? // using (Image source = provider.GetImage()) // using (MemoryStream ms = new MemoryStream()) // { @@ -103,7 +103,7 @@ public void GeneralTest(TestImageProvider provider) public void Resize(TestImageProvider provider) where TPixel : struct, IPixel { - // does saving a file then repoening mean both files are identical??? + // does saving a file then reopening mean both files are identical??? using (Image image = provider.GetImage()) using (MemoryStream ms = new MemoryStream()) { diff --git a/tests/ImageSharp.Tests/GlobalSuppressions.cs b/tests/ImageSharp.Tests/GlobalSuppressions.cs index 3d161049b9..2709d32ebc 100644 --- a/tests/ImageSharp.Tests/GlobalSuppressions.cs +++ b/tests/ImageSharp.Tests/GlobalSuppressions.cs @@ -1,7 +1,7 @@ - -// This file is used by Code Analysis to maintain SuppressMessage + +// This file is used by Code Analysis to maintain SuppressMessage // attributes that are applied to this project. -// Project-level suppressions either have no target or are given +// Project-level suppressions either have no target or are given // a specific target and scoped to a namespace, type, member, etc. [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "xUnit1026:Theory methods should use all of their parameters")] diff --git a/tests/ImageSharp.Tests/Image/ImageFrameCollectionTests.Generic.cs b/tests/ImageSharp.Tests/Image/ImageFrameCollectionTests.Generic.cs index 37c3a27cd0..e4c7e2231a 100644 --- a/tests/ImageSharp.Tests/Image/ImageFrameCollectionTests.Generic.cs +++ b/tests/ImageSharp.Tests/Image/ImageFrameCollectionTests.Generic.cs @@ -275,24 +275,24 @@ public void AddFrameFromPixelData() public void AddFrame_clones_sourceFrame() { var pixelData = this.Image.Frames.RootFrame.GetPixelSpan().ToArray(); - var otherFRame = new ImageFrame(Configuration.Default, 10, 10); - var addedFrame = this.Image.Frames.AddFrame(otherFRame); - addedFrame.ComparePixelBufferTo(otherFRame.GetPixelSpan()); - Assert.NotEqual(otherFRame, addedFrame); + var otherFrame = new ImageFrame(Configuration.Default, 10, 10); + var addedFrame = this.Image.Frames.AddFrame(otherFrame); + addedFrame.ComparePixelBufferTo(otherFrame.GetPixelSpan()); + Assert.NotEqual(otherFrame, addedFrame); } [Fact] public void InsertFrame_clones_sourceFrame() { var pixelData = this.Image.Frames.RootFrame.GetPixelSpan().ToArray(); - var otherFRame = new ImageFrame(Configuration.Default, 10, 10); - var addedFrame = this.Image.Frames.InsertFrame(0, otherFRame); - addedFrame.ComparePixelBufferTo(otherFRame.GetPixelSpan()); - Assert.NotEqual(otherFRame, addedFrame); + var otherFrame = new ImageFrame(Configuration.Default, 10, 10); + var addedFrame = this.Image.Frames.InsertFrame(0, otherFrame); + addedFrame.ComparePixelBufferTo(otherFrame.GetPixelSpan()); + Assert.NotEqual(otherFrame, addedFrame); } [Fact] - public void MoveFrame_LeavesFrmaeInCorrectLocation() + public void MoveFrame_LeavesFrameInCorrectLocation() { for (var i = 0; i < 9; i++) { diff --git a/tests/ImageSharp.Tests/Image/ImageFrameCollectionTests.NonGeneric.cs b/tests/ImageSharp.Tests/Image/ImageFrameCollectionTests.NonGeneric.cs index fc0aafac6b..50358a9d09 100644 --- a/tests/ImageSharp.Tests/Image/ImageFrameCollectionTests.NonGeneric.cs +++ b/tests/ImageSharp.Tests/Image/ImageFrameCollectionTests.NonGeneric.cs @@ -214,7 +214,7 @@ public void CreateFrame_CustomFillColor() } [Fact] - public void MoveFrame_LeavesFrmaeInCorrectLocation() + public void MoveFrame_LeavesFrameInCorrectLocation() { for (var i = 0; i < 9; i++) { diff --git a/tests/ImageSharp.Tests/Image/ImageTests.Save.cs b/tests/ImageSharp.Tests/Image/ImageTests.Save.cs index 45399919a0..b8eb52d9e7 100644 --- a/tests/ImageSharp.Tests/Image/ImageTests.Save.cs +++ b/tests/ImageSharp.Tests/Image/ImageTests.Save.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. // ReSharper disable InconsistentNaming @@ -17,10 +17,10 @@ public partial class ImageTests public class Save { [Fact] - public void DetecedEncoding() + public void DetectedEncoding() { string dir = TestEnvironment.CreateOutputDirectory(nameof(ImageTests)); - string file = System.IO.Path.Combine(dir, "DetecedEncoding.png"); + string file = System.IO.Path.Combine(dir, "DetectedEncoding.png"); using (var image = new Image(10, 10)) { @@ -67,4 +67,4 @@ public void SetEncoding() } } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/ImageOperationTests.cs b/tests/ImageSharp.Tests/ImageOperationTests.cs index 30371f0008..455e2c5f1b 100644 --- a/tests/ImageSharp.Tests/ImageOperationTests.cs +++ b/tests/ImageSharp.Tests/ImageOperationTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using System; @@ -81,7 +81,7 @@ public void CloneCallsImageOperationsProvider_ListOfProcessors_WithDuplicateImag } [Fact] - public void CloneCallsImageOperationsProvider_Func_NotOnOrigional() + public void CloneCallsImageOperationsProvider_Func_NotOnOriginal() { Image returned = this.image.Clone(x => x.ApplyProcessor(this.processorDefinition)); Assert.False(this.provider.HasCreated(this.image)); @@ -91,7 +91,7 @@ public void CloneCallsImageOperationsProvider_Func_NotOnOrigional() } [Fact] - public void CloneCallsImageOperationsProvider_ListOfProcessors_NotOnOrigional() + public void CloneCallsImageOperationsProvider_ListOfProcessors_NotOnOriginal() { Image returned = this.image.Clone(this.processorDefinition); Assert.False(this.provider.HasCreated(this.image)); @@ -110,4 +110,4 @@ public void ApplyProcessors_ListOfProcessors_AppliesAllProcessorsToOperation() public void Dispose() => this.image.Dispose(); } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.PrimitivesTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.PrimitivesTests.cs index 098950be85..464a701411 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.PrimitivesTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.PrimitivesTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using System; @@ -46,7 +46,7 @@ public void WriteAsciiStringWithNullWritesEmpty() } [Fact] - public void WriteAsciiStringWithNegativeLenghtThrowsArgumentException() + public void WriteAsciiStringWithNegativeLengthThrowsArgumentException() { IccDataWriter writer = CreateWriter(); diff --git a/tests/ImageSharp.Tests/Numerics/SignedRationalTests.cs b/tests/ImageSharp.Tests/Numerics/SignedRationalTests.cs index 77920ba2fe..f828cf74f5 100644 --- a/tests/ImageSharp.Tests/Numerics/SignedRationalTests.cs +++ b/tests/ImageSharp.Tests/Numerics/SignedRationalTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.Primitives; @@ -98,7 +98,7 @@ public void ToDouble() } [Fact] - public void ToStringRepresention() + public void ToStringRepresentation() { var rational = new SignedRational(0, 0); Assert.Equal("[ Indeterminate ]", rational.ToString()); @@ -119,4 +119,4 @@ public void ToStringRepresention() Assert.Equal("1/2", rational.ToString()); } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/PixelFormats/PixelBlenders/PorterDuffFunctionsTests.cs b/tests/ImageSharp.Tests/PixelFormats/PixelBlenders/PorterDuffFunctionsTests.cs index 9a196d9d5b..f0b27d4869 100644 --- a/tests/ImageSharp.Tests/PixelFormats/PixelBlenders/PorterDuffFunctionsTests.cs +++ b/tests/ImageSharp.Tests/PixelFormats/PixelBlenders/PorterDuffFunctionsTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using System.Numerics; @@ -61,7 +61,7 @@ public void AddFunction(TestVector4 back, TestVector4 source, float amount, Test VectorAssert.Equal(expected, actual, 5); } - public static TheoryData SubstractFunctionData = new TheoryData() { + public static TheoryData SubtractFunctionData = new TheoryData() { { new TestVector4(1,1,1,1), new TestVector4(1,1,1,1), 1, new TestVector4(0,0,0,1) }, { new TestVector4(1,1,1,1), new TestVector4(0,0,0,.8f), .5f, new TestVector4(1,1,1, 1f) }, { @@ -73,8 +73,8 @@ public void AddFunction(TestVector4 back, TestVector4 source, float amount, Test }; [Theory] - [MemberData(nameof(SubstractFunctionData))] - public void SubstractFunction(TestVector4 back, TestVector4 source, float amount, TestVector4 expected) + [MemberData(nameof(SubtractFunctionData))] + public void SubtractFunction(TestVector4 back, TestVector4 source, float amount, TestVector4 expected) { Vector4 actual = PorterDuffFunctions.SubtractSrcOver((Vector4)back, source, amount); VectorAssert.Equal(expected, actual, 5); diff --git a/tests/ImageSharp.Tests/PixelFormats/PixelBlenders/PorterDuffFunctionsTests_TPixel.cs b/tests/ImageSharp.Tests/PixelFormats/PixelBlenders/PorterDuffFunctionsTests_TPixel.cs index 9ca1e30cce..0e270dfda4 100644 --- a/tests/ImageSharp.Tests/PixelFormats/PixelBlenders/PorterDuffFunctionsTests_TPixel.cs +++ b/tests/ImageSharp.Tests/PixelFormats/PixelBlenders/PorterDuffFunctionsTests_TPixel.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using System; @@ -130,7 +130,7 @@ public void AddFunctionBlenderBulk(TestPixel back, TestPixel SubstractFunctionData = new TheoryData() { + public static TheoryData SubtractFunctionData = new TheoryData() { { new TestPixel(1,1,1,1), new TestPixel(1,1,1,1), 1, new TestPixel(0,0,0,1) }, { new TestPixel(1,1,1,1), new TestPixel(0,0,0,.8f), .5f, new TestPixel(1,1,1, 1f) }, { @@ -142,8 +142,8 @@ public void AddFunctionBlenderBulk(TestPixel back, TestPixel(TestPixel back, TestPixel source, float amount, TestPixel expected) + [MemberData(nameof(SubtractFunctionData))] + public void SubtractFunction(TestPixel back, TestPixel source, float amount, TestPixel expected) where TPixel : struct, IPixel { TPixel actual = PorterDuffFunctions.SubtractSrcOver((TPixel)back, source, amount); @@ -151,8 +151,8 @@ public void SubstractFunction(TestPixel back, TestPixel } [Theory] - [MemberData(nameof(SubstractFunctionData))] - public void SubstractFunctionBlender(TestPixel back, TestPixel source, float amount, TestPixel expected) + [MemberData(nameof(SubtractFunctionData))] + public void SubtractFunctionBlender(TestPixel back, TestPixel source, float amount, TestPixel expected) where TPixel : struct, IPixel { TPixel actual = new DefaultPixelBlenders.SubtractSrcOver().Blend(back, source, amount); @@ -160,8 +160,8 @@ public void SubstractFunctionBlender(TestPixel back, TestPixel(TestPixel back, TestPixel source, float amount, TestPixel expected) + [MemberData(nameof(SubtractFunctionData))] + public void SubtractFunctionBlenderBulk(TestPixel back, TestPixel source, float amount, TestPixel expected) where TPixel : struct, IPixel { var dest = new Span(new TPixel[1]); diff --git a/tests/ImageSharp.Tests/PixelFormats/Rgba32Tests.cs b/tests/ImageSharp.Tests/PixelFormats/Rgba32Tests.cs index 429a655834..1ab5f8e3df 100644 --- a/tests/ImageSharp.Tests/PixelFormats/Rgba32Tests.cs +++ b/tests/ImageSharp.Tests/PixelFormats/Rgba32Tests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using System; @@ -107,7 +107,7 @@ public void FromAndToHex() } /// - /// Tests that the individual byte elements are layed out in RGBA order. + /// Tests that the individual byte elements are laid out in RGBA order. /// [Fact] public unsafe void ByteLayout() @@ -290,4 +290,4 @@ public void Rgba32_FromBgra5551() Assert.Equal(expected, rgb.PackedValue); } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/PixelFormats/RgbaVectorTests.cs b/tests/ImageSharp.Tests/PixelFormats/RgbaVectorTests.cs index 570d72cf49..fe2f8394ff 100644 --- a/tests/ImageSharp.Tests/PixelFormats/RgbaVectorTests.cs +++ b/tests/ImageSharp.Tests/PixelFormats/RgbaVectorTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using System.Numerics; @@ -99,7 +99,7 @@ public void FromAndToHex() } /// - /// Tests that the individual float elements are layed out in RGBA order. + /// Tests that the individual float elements are laid out in RGBA order. /// [Fact] public void FloatLayout() @@ -189,4 +189,4 @@ public void RgbaVector_FromGrey8() Assert.Equal(expected, rgba.ToScaledVector4()); } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs index e6ae77a01b..43384aee7c 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using System; @@ -33,8 +33,8 @@ public class ResizeTests public static readonly string[] SmokeTestResamplerNames = { - nameof(KnownResamplers.NearestNeighbor), - nameof(KnownResamplers.Bicubic), + nameof(KnownResamplers.NearestNeighbor), + nameof(KnownResamplers.Bicubic), nameof(KnownResamplers.Box), nameof(KnownResamplers.Lanczos5), }; @@ -46,18 +46,18 @@ public class ResizeTests public void Resize_PixelAgnostic() { var filePath = TestFile.GetInputFileFullPath(TestImages.Jpeg.Baseline.Calliphora); - + using (Image image = Image.Load(filePath)) { image.Mutate(x => x.Resize(image.Size() / 2)); string path = System.IO.Path.Combine( TestEnvironment.CreateOutputDirectory(nameof(ResizeTests)), nameof(this.Resize_PixelAgnostic) + ".png"); - + image.Save(path); } } - + [Theory( Skip = "Debug only, enable manually" )] @@ -80,7 +80,7 @@ public void LargeImage(TestImageProvider provider, int destSize, image.DebugSave(provider, appendPixelTypeToFileName: false); } } - + [Theory] [WithBasicTestPatternImages(15, 12, PixelTypes.Rgba32, 2, 3, 1, 2)] [WithBasicTestPatternImages(2, 256, PixelTypes.Rgba32, 1, 1, 1, 8)] @@ -92,7 +92,7 @@ public void Resize_BasicSmall(TestImageProvider provider, int wN // [WithBasicTestPatternImages(15, 12, PixelTypes.Rgba32, 2, 3, 1, 2)] means: // resizing: (15, 12) -> (10, 6) // kernel dimensions: (3, 4) - + using (Image image = provider.GetImage()) { @@ -122,9 +122,9 @@ public void WorkingBufferSizeHintInBytes_IsAppliedCorrectly( using (Image image0 = provider.GetImage()) { Size destSize = image0.Size() / 4; - + Configuration configuration = Configuration.CreateDefaultInstance(); - + int workingBufferSizeHintInBytes = workingBufferLimitInRows * destSize.Width * SizeOfVector4; TestMemoryAllocator allocator = new TestMemoryAllocator(); configuration.MemoryAllocator = allocator; @@ -137,7 +137,7 @@ public void WorkingBufferSizeHintInBytes_IsAppliedCorrectly( Configuration.Default.MemoryAllocator); int minimumWorkerAllocationInBytes = verticalKernelMap.MaxDiameter * 2 * destSize.Width * SizeOfVector4; verticalKernelMap.Dispose(); - + using (Image image = image0.Clone(configuration)) { image.Mutate(x => x.Resize(destSize, KnownResamplers.Bicubic, false)); @@ -151,12 +151,12 @@ public void WorkingBufferSizeHintInBytes_IsAppliedCorrectly( provider, testOutputDetails: workingBufferLimitInRows, appendPixelTypeToFileName: false); - + Assert.NotEmpty(allocator.AllocationLog); int maxAllocationSize = allocator.AllocationLog.Where( e => e.ElementType == typeof(Vector4)).Max(e => e.LengthInBytes); - + Assert.True(maxAllocationSize <= Math.Max(workingBufferSizeHintInBytes, minimumWorkerAllocationInBytes)); } } @@ -284,7 +284,7 @@ public void Resize_WorksWithAllResamplers( { IResampler sampler = TestUtils.GetResampler(samplerName); - // NeirestNeighbourResampler is producing slightly different results With classic .NET framework on 32bit + // NearestNeighbourResampler is producing slightly different results With classic .NET framework on 32bit // most likely because of differences in numeric behavior. // The difference is well visible when comparing output for // Resize_WorksWithAllResamplers_TestPattern301x1180_NearestNeighbor-300x480.png @@ -297,7 +297,7 @@ public void Resize_WorksWithAllResamplers( // Let's make the working buffer size non-default: provider.Configuration.WorkingBufferSizeHintInBytes = 16 * 1024 * SizeOfVector4; - + provider.RunValidatingProcessorTest( ctx => { @@ -538,4 +538,4 @@ public void ResizeWithStretchMode(TestImageProvider provider) } } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/Processing/Transforms/ProjectiveTransformTests.cs b/tests/ImageSharp.Tests/Processing/Transforms/ProjectiveTransformTests.cs index 056f66af7f..3679180f49 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/ProjectiveTransformTests.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/ProjectiveTransformTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using System; @@ -103,7 +103,7 @@ public void Transform_WithTaperMatrix(TestImageProvider provider public void RawTransformMatchesDocumentedExample(TestImageProvider provider) where TPixel : struct, IPixel { - // Printing some extra output to help investigating roundoff errors: + // Printing some extra output to help investigating rounding errors: this.Output.WriteLine($"Vector.IsHardwareAccelerated: {Vector.IsHardwareAccelerated}"); // This test matches the output described in the example at @@ -160,4 +160,4 @@ private static IResampler GetResampler(string name) return (IResampler)property.GetValue(null); } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/Quantization/QuantizedImageTests.cs b/tests/ImageSharp.Tests/Quantization/QuantizedImageTests.cs index 04e9803af4..7750017095 100644 --- a/tests/ImageSharp.Tests/Quantization/QuantizedImageTests.cs +++ b/tests/ImageSharp.Tests/Quantization/QuantizedImageTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using System; @@ -18,17 +18,17 @@ public class QuantizedImageTests public void QuantizersDitherByDefault() { var werner = new WernerPaletteQuantizer(); - var websafe = new WebSafePaletteQuantizer(); + var webSafe = new WebSafePaletteQuantizer(); var octree = new OctreeQuantizer(); var wu = new WuQuantizer(); Assert.NotNull(werner.Diffuser); - Assert.NotNull(websafe.Diffuser); + Assert.NotNull(webSafe.Diffuser); Assert.NotNull(octree.Diffuser); Assert.NotNull(wu.Diffuser); Assert.True(werner.CreateFrameQuantizer(this.Configuration).Dither); - Assert.True(websafe.CreateFrameQuantizer(this.Configuration).Dither); + Assert.True(webSafe.CreateFrameQuantizer(this.Configuration).Dither); Assert.True(octree.CreateFrameQuantizer(this.Configuration).Dither); Assert.True(wu.CreateFrameQuantizer(this.Configuration).Dither); } @@ -101,4 +101,4 @@ private int GetTransparentIndex(IQuantizedFrame quantized) return index; } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/TestFormat.cs b/tests/ImageSharp.Tests/TestFormat.cs index 069f10198e..0a56110560 100644 --- a/tests/ImageSharp.Tests/TestFormat.cs +++ b/tests/ImageSharp.Tests/TestFormat.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using System; @@ -212,7 +212,7 @@ public Image Decode(Configuration config, Stream stream) where T pixelType = typeof(TPixel) }); - // TODO record this happend so we can verify it. + // TODO record this happened so we can verify it. return this.testFormat.Sample(); } diff --git a/tests/ImageSharp.Tests/TestUtilities/ArrayHelper.cs b/tests/ImageSharp.Tests/TestUtilities/ArrayHelper.cs index e35cbfa422..fdb694dccb 100644 --- a/tests/ImageSharp.Tests/TestUtilities/ArrayHelper.cs +++ b/tests/ImageSharp.Tests/TestUtilities/ArrayHelper.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using System.Linq; @@ -11,16 +11,16 @@ public static class ArrayHelper /// Concatenates multiple arrays of the same type into one. /// /// The array type - /// The arrays to concatenate. The order is kept + /// The arrays to concatenate. The order is kept /// The concatenated array - public static T[] Concat(params T[][] arrs) + public static T[] Concat(params T[][] arrays) { - var result = new T[arrs.Sum(t => t.Length)]; + var result = new T[arrays.Sum(t => t.Length)]; int offset = 0; - for (int i = 0; i < arrs.Length; i++) + for (int i = 0; i < arrays.Length; i++) { - arrs[i].CopyTo(result, offset); - offset += arrs[i].Length; + arrays[i].CopyTo(result, offset); + offset += arrays[i].Length; } return result; } diff --git a/tests/ImageSharp.Tests/TestUtilities/Attributes/ImageDataAttributeBase.cs b/tests/ImageSharp.Tests/TestUtilities/Attributes/ImageDataAttributeBase.cs index 6107154d0e..ee1665138a 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Attributes/ImageDataAttributeBase.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Attributes/ImageDataAttributeBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using System; @@ -72,8 +72,8 @@ public override IEnumerable GetData(MethodInfo testMethod) addedRows = new[] { new object[0] }; } - bool firstIsprovider = this.FirstIsProvider(testMethod); - if (firstIsprovider) + bool firstIsProvider = this.FirstIsProvider(testMethod); + if (firstIsProvider) { return this.InnerGetData(testMethod, addedRows); } @@ -98,12 +98,12 @@ private IEnumerable InnerGetData(MethodInfo testMethod, IEnumerable).MakeGenericType(kv.Value); - foreach (object[] originalFacoryMethodArgs in this.GetAllFactoryMethodArgs(testMethod, factoryType)) + foreach (object[] originalFactoryMethodArgs in this.GetAllFactoryMethodArgs(testMethod, factoryType)) { foreach (object[] row in memberData) { - object[] actualFactoryMethodArgs = new object[originalFacoryMethodArgs.Length + 2]; - Array.Copy(originalFacoryMethodArgs, actualFactoryMethodArgs, originalFacoryMethodArgs.Length); + object[] actualFactoryMethodArgs = new object[originalFactoryMethodArgs.Length + 2]; + Array.Copy(originalFactoryMethodArgs, actualFactoryMethodArgs, originalFactoryMethodArgs.Length); actualFactoryMethodArgs[actualFactoryMethodArgs.Length - 2] = testMethod; actualFactoryMethodArgs[actualFactoryMethodArgs.Length - 1] = kv.Key; @@ -192,4 +192,4 @@ protected Func GetPropertyAccessor(Type type, string memberName) return () => propInfo.GetValue(null, null); } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/TestUtilities/ImageComparison/ExactImageComparer.cs b/tests/ImageSharp.Tests/TestUtilities/ImageComparison/ExactImageComparer.cs index 462782ba5e..59167cc888 100644 --- a/tests/ImageSharp.Tests/TestUtilities/ImageComparison/ExactImageComparer.cs +++ b/tests/ImageSharp.Tests/TestUtilities/ImageComparison/ExactImageComparer.cs @@ -22,7 +22,7 @@ public override ImageSimilarityReport CompareImagesOrFrames CompareImagesOrFrames(expected, actual, differences); } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/TestUtilities/ImageComparison/TolerantImageComparer.cs b/tests/ImageSharp.Tests/TestUtilities/ImageComparison/TolerantImageComparer.cs index be12f56211..8bed3a7155 100644 --- a/tests/ImageSharp.Tests/TestUtilities/ImageComparison/TolerantImageComparer.cs +++ b/tests/ImageSharp.Tests/TestUtilities/ImageComparison/TolerantImageComparer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Runtime.CompilerServices; @@ -19,7 +19,7 @@ public class TolerantImageComparer : ImageComparer /// Individual manhattan pixel difference is only added to total image difference when the individual difference is over 'perPixelManhattanThreshold'. /// /// The maximal tolerated difference represented by a value between 0.0 and 1.0 scaled to 0 and 65535. - /// Gets the threshold of the individual pixels before they acumulate towards the overall difference. + /// Gets the threshold of the individual pixels before they accumulate towards the overall difference. public TolerantImageComparer(float imageThreshold, int perPixelManhattanThreshold = 0) { Guard.MustBeGreaterThanOrEqualTo(imageThreshold, 0, nameof(imageThreshold)); @@ -49,7 +49,7 @@ public TolerantImageComparer(float imageThreshold, int perPixelManhattanThreshol public float ImageThreshold { get; } /// - /// Gets the threshold of the individual pixels before they acumulate towards the overall difference. + /// Gets the threshold of the individual pixels before they accumulate towards the overall difference. /// For an individual pixel pair the value is the Manhattan distance of pixels: /// /// https://en.wikipedia.org/wiki/Taxicab_geometry @@ -66,7 +66,7 @@ public override ImageSimilarityReport CompareImagesOrFrames Math.Abs(a - b); } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestImageProvider.cs b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestImageProvider.cs index 8d493c7d43..1a33efd34c 100644 --- a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestImageProvider.cs +++ b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestImageProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using System; @@ -36,7 +36,7 @@ public abstract partial class TestImageProvider : ITestImageProvider public Configuration Configuration { get; set; } = Configuration.CreateDefaultInstance(); /// - /// Utility instance to provide informations about the test image & manage input/output + /// Utility instance to provide information about the test image & manage input/output /// public ImagingTestCaseUtility Utility { get; private set; } @@ -132,7 +132,7 @@ public virtual void Serialize(IXunitSerializationInfo info) protected TestImageProvider Init( string typeName, string methodName, - string outputSubfolerName, + string outputSubfolderName, PixelTypes pixelTypeOverride) { if (pixelTypeOverride != PixelTypes.Undefined) @@ -141,7 +141,7 @@ protected TestImageProvider Init( } this.TypeName = typeName; this.MethodName = methodName; - this.OutputSubfolderName = outputSubfolerName; + this.OutputSubfolderName = outputSubfolderName; this.Utility = new ImagingTestCaseUtility { @@ -151,7 +151,7 @@ protected TestImageProvider Init( if (methodName != null) { - this.Utility.Init(typeName, methodName, outputSubfolerName); + this.Utility.Init(typeName, methodName, outputSubfolderName); } return this; @@ -170,4 +170,4 @@ public override string ToString() return $"{this.SourceFileOrDescription}[{this.PixelType}]"; } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestPatternProvider.cs b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestPatternProvider.cs index f831122784..5694617c1c 100644 --- a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestPatternProvider.cs +++ b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestPatternProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using System; @@ -140,7 +140,7 @@ private static void BlackWhiteChecker(Buffer2D pixels) } /// - /// Fills the bottom left quadrent with 3 horizental bars in Red, Green and Blue with a alpha gradient from left (transparent) to right (solid). + /// Fills the bottom left quadrant with 3 horizontal bars in Red, Green and Blue with a alpha gradient from left (transparent) to right (solid). /// /// private static void TransparentGradients(Buffer2D pixels) @@ -184,7 +184,7 @@ private static void TransparentGradients(Buffer2D pixels) } /// - /// Fills the bottom right quadrant with all the colors producable by converting itterating over a uint and unpacking it. + /// Fills the bottom right quadrant with all the colors producible by converting iterating over a uint and unpacking it. /// A better algorithm could be used but it works /// /// @@ -214,4 +214,4 @@ private static void Rainbow(Buffer2D pixels) } } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/TestUtilities/MeasureFixture.cs b/tests/ImageSharp.Tests/TestUtilities/MeasureFixture.cs index 6d06ec5e93..61bd7cd9fb 100644 --- a/tests/ImageSharp.Tests/TestUtilities/MeasureFixture.cs +++ b/tests/ImageSharp.Tests/TestUtilities/MeasureFixture.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using System; @@ -14,7 +14,7 @@ namespace SixLabors.ImageSharp.Tests public class MeasureFixture { /// - /// Value indicating whether priniting is enabled. + /// Value indicating whether printing is enabled. /// protected bool EnablePrinting = true; @@ -79,4 +79,4 @@ public void Dispose() this.Output.WriteLine($"{this.operation} completed in {this.stopwatch.ElapsedMilliseconds}ms"); } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/TestUtilities/TestImageExtensions.cs b/tests/ImageSharp.Tests/TestUtilities/TestImageExtensions.cs index 1bd3396561..91943d9a6a 100644 --- a/tests/ImageSharp.Tests/TestUtilities/TestImageExtensions.cs +++ b/tests/ImageSharp.Tests/TestUtilities/TestImageExtensions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Six Labors and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using System; @@ -537,7 +537,7 @@ public static Image CompareToOriginal( /// Utility method for doing the following in one step: /// 1. Executing an operation (taken as a delegate) /// 2. Executing DebugSave() - /// 3. Executing CopareToReferenceOutput() + /// 3. Executing CompareToReferenceOutput() /// internal static void VerifyOperation( this TestImageProvider provider, @@ -570,7 +570,7 @@ internal static void VerifyOperation( /// Utility method for doing the following in one step: /// 1. Executing an operation (taken as a delegate) /// 2. Executing DebugSave() - /// 3. Executing CopareToReferenceOutput() + /// 3. Executing CompareToReferenceOutput() /// internal static void VerifyOperation( this TestImageProvider provider, @@ -592,7 +592,7 @@ internal static void VerifyOperation( /// Utility method for doing the following in one step: /// 1. Executing an operation (taken as a delegate) /// 2. Executing DebugSave() - /// 3. Executing CopareToReferenceOutput() + /// 3. Executing CompareToReferenceOutput() /// internal static void VerifyOperation( this TestImageProvider provider, @@ -614,7 +614,7 @@ internal static void VerifyOperation( /// Utility method for doing the following in one step: /// 1. Executing an operation (taken as a delegate) /// 2. Executing DebugSave() - /// 3. Executing CopareToReferenceOutput() + /// 3. Executing CompareToReferenceOutput() /// internal static void VerifyOperation( this TestImageProvider provider, @@ -709,4 +709,4 @@ protected override void OnFrameApply(ImageFrame source, Rectangle source } } } -} \ No newline at end of file +}