diff --git a/README.md b/README.md index 3c343ad135..078219183e 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ using SixLabors.ImageSharp; using SixLabors.ImageSharp.PixelFormats; // Individual pixels -using (Image image = new Image(400, 400)) +using (var image = new Image(400, 400)) { image[200, 200] = Rgba32.White; } diff --git a/src/ImageSharp.Drawing/Processing/DrawingHelpers.cs b/src/ImageSharp.Drawing/Processing/DrawingHelpers.cs index b4ce0c5cba..25a8204f2a 100644 --- a/src/ImageSharp.Drawing/Processing/DrawingHelpers.cs +++ b/src/ImageSharp.Drawing/Processing/DrawingHelpers.cs @@ -14,9 +14,9 @@ internal static class DrawingHelpers public static DenseMatrix ToPixelMatrix(this DenseMatrix colorMatrix, Configuration configuration) where TPixel : struct, IPixel { - DenseMatrix result = new DenseMatrix(colorMatrix.Columns, colorMatrix.Rows); + var result = new DenseMatrix(colorMatrix.Columns, colorMatrix.Rows); Color.ToPixel(configuration, colorMatrix.Span, result.Span); return result; } } -} \ No newline at end of file +} diff --git a/src/ImageSharp/Common/Extensions/StreamExtensions.cs b/src/ImageSharp/Common/Extensions/StreamExtensions.cs index 505ecccdda..6af09b220a 100644 --- a/src/ImageSharp/Common/Extensions/StreamExtensions.cs +++ b/src/ImageSharp/Common/Extensions/StreamExtensions.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; @@ -60,7 +60,7 @@ public static void Skip(this Stream stream, int count) } else { - byte[] foo = new byte[count]; + var foo = new byte[count]; while (count > 0) { int bytesRead = stream.Read(foo, 0, count); diff --git a/src/ImageSharp/Common/Helpers/SimdUtils.BasicIntrinsics256.cs b/src/ImageSharp/Common/Helpers/SimdUtils.BasicIntrinsics256.cs index b16bbc86b6..5aa0b21ec1 100644 --- a/src/ImageSharp/Common/Helpers/SimdUtils.BasicIntrinsics256.cs +++ b/src/ImageSharp/Common/Helpers/SimdUtils.BasicIntrinsics256.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; @@ -138,8 +138,8 @@ internal static void BulkConvertNormalizedFloatToByteClampOverflows(ReadOnlySpan ref Octet.OfByte destBase = ref Unsafe.As(ref MemoryMarshal.GetReference(dest)); int n = source.Length / 8; - Vector magick = new Vector(32768.0f); - Vector scale = new Vector(255f) / new Vector(256f); + var magick = new Vector(32768.0f); + var scale = new Vector(255f) / new Vector(256f); // need to copy to a temporary struct, because // SimdUtils.Octet.OfUInt32 temp = Unsafe.As, SimdUtils.Octet.OfUInt32>(ref x) @@ -187,8 +187,8 @@ internal static void BulkConvertNormalizedFloatToByte(ReadOnlySpan source ref Octet.OfByte destBase = ref Unsafe.As(ref MemoryMarshal.GetReference(dest)); int n = source.Length / 8; - Vector magick = new Vector(32768.0f); - Vector scale = new Vector(255f) / new Vector(256f); + var magick = new Vector(32768.0f); + var scale = new Vector(255f) / new Vector(256f); // need to copy to a temporary struct, because // SimdUtils.Octet.OfUInt32 temp = Unsafe.As, SimdUtils.Octet.OfUInt32>(ref x) @@ -211,4 +211,4 @@ internal static void BulkConvertNormalizedFloatToByte(ReadOnlySpan source } } } -} \ No newline at end of file +} diff --git a/src/ImageSharp/Common/Helpers/SimdUtils.ExtendedIntrinsics.cs b/src/ImageSharp/Common/Helpers/SimdUtils.ExtendedIntrinsics.cs index 83216aaa72..7baa788e41 100644 --- a/src/ImageSharp/Common/Helpers/SimdUtils.ExtendedIntrinsics.cs +++ b/src/ImageSharp/Common/Helpers/SimdUtils.ExtendedIntrinsics.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; @@ -172,7 +172,7 @@ internal static void BulkConvertNormalizedFloatToByteClampOverflows( [MethodImpl(MethodImplOptions.AggressiveInlining)] private static Vector ConvertToUInt32(Vector vf) { - Vector maxBytes = new Vector(255f); + var maxBytes = new Vector(255f); vf *= maxBytes; vf += new Vector(0.5f); vf = Vector.Min(Vector.Max(vf, Vector.Zero), maxBytes); @@ -190,4 +190,4 @@ private static Vector ConvertToSingle(Vector u) } } } -} \ No newline at end of file +} diff --git a/src/ImageSharp/Common/Helpers/SimdUtils.cs b/src/ImageSharp/Common/Helpers/SimdUtils.cs index 45761a0d07..4c34e28bc8 100644 --- a/src/ImageSharp/Common/Helpers/SimdUtils.cs +++ b/src/ImageSharp/Common/Helpers/SimdUtils.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; @@ -43,7 +43,7 @@ internal static Vector4 PseudoRound(this Vector4 v) [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static Vector FastRound(this Vector v) { - Vector magic0 = new Vector(int.MinValue); // 0x80000000 + var magic0 = new Vector(int.MinValue); // 0x80000000 Vector sgn0 = Vector.AsVectorSingle(magic0); Vector and0 = Vector.BitwiseAnd(sgn0, v); Vector or0 = Vector.BitwiseOr(and0, new Vector(8388608.0f)); @@ -179,4 +179,4 @@ private static void VerifySpanInput(ReadOnlySpan source, Span dest, $"length should be divisible by {shouldBeDivisibleBy}!"); } } -} \ No newline at end of file +} diff --git a/src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs b/src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs index 906fc53fef..b7733e0269 100644 --- a/src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs +++ b/src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs @@ -446,7 +446,7 @@ private void UncompressRle4(int w, Span buffer, Span undefinedPixels #if NETCOREAPP2_1 Span cmd = stackalloc byte[2]; #else - byte[] cmd = new byte[2]; + var cmd = new byte[2]; #endif int count = 0; @@ -485,7 +485,7 @@ private void UncompressRle4(int w, Span buffer, Span undefinedPixels int max = cmd[1]; int bytesToRead = (max + 1) / 2; - byte[] run = new byte[bytesToRead]; + var run = new byte[bytesToRead]; this.stream.Read(run, 0, run.Length); @@ -557,7 +557,7 @@ private void UncompressRle8(int w, Span buffer, Span undefinedPixels #if NETCOREAPP2_1 Span cmd = stackalloc byte[2]; #else - byte[] cmd = new byte[2]; + var cmd = new byte[2]; #endif int count = 0; @@ -595,7 +595,7 @@ private void UncompressRle8(int w, Span buffer, Span undefinedPixels // Take this number of bytes from the stream as uncompressed data. int length = cmd[1]; - byte[] run = new byte[length]; + var run = new byte[length]; this.stream.Read(run, 0, run.Length); @@ -640,7 +640,7 @@ private void UncompressRle24(int w, Span buffer, Span undefinedPixel #if NETCOREAPP2_1 Span cmd = stackalloc byte[2]; #else - byte[] cmd = new byte[2]; + var cmd = new byte[2]; #endif int uncompressedPixels = 0; @@ -678,7 +678,7 @@ private void UncompressRle24(int w, Span buffer, Span undefinedPixel // Take this number of bytes from the stream as uncompressed data. int length = cmd[1]; - byte[] run = new byte[length * 3]; + var run = new byte[length * 3]; this.stream.Read(run, 0, run.Length); @@ -1214,7 +1214,7 @@ private void ReadInfoHeader() #if NETCOREAPP2_1 Span buffer = stackalloc byte[BmpInfoHeader.MaxHeaderSize]; #else - byte[] buffer = new byte[BmpInfoHeader.MaxHeaderSize]; + var buffer = new byte[BmpInfoHeader.MaxHeaderSize]; #endif // Read the header size. @@ -1252,7 +1252,7 @@ private void ReadInfoHeader() // color masks for each color channel follow the info header. if (this.infoHeader.Compression == BmpCompression.BitFields) { - byte[] bitfieldsBuffer = new byte[12]; + var bitfieldsBuffer = new byte[12]; this.stream.Read(bitfieldsBuffer, 0, 12); Span data = bitfieldsBuffer.AsSpan(); this.infoHeader.RedMask = BinaryPrimitives.ReadInt32LittleEndian(data.Slice(0, 4)); @@ -1261,7 +1261,7 @@ private void ReadInfoHeader() } else if (this.infoHeader.Compression == BmpCompression.BI_ALPHABITFIELDS) { - byte[] bitfieldsBuffer = new byte[16]; + var bitfieldsBuffer = new byte[16]; this.stream.Read(bitfieldsBuffer, 0, 16); Span data = bitfieldsBuffer.AsSpan(); this.infoHeader.RedMask = BinaryPrimitives.ReadInt32LittleEndian(data.Slice(0, 4)); @@ -1340,7 +1340,7 @@ private void ReadFileHeader() #if NETCOREAPP2_1 Span buffer = stackalloc byte[BmpFileHeader.Size]; #else - byte[] buffer = new byte[BmpFileHeader.Size]; + var buffer = new byte[BmpFileHeader.Size]; #endif this.stream.Read(buffer, 0, BmpFileHeader.Size); diff --git a/src/ImageSharp/Formats/Bmp/BmpEncoderCore.cs b/src/ImageSharp/Formats/Bmp/BmpEncoderCore.cs index 4e6ec45021..a5e1ee5dbc 100644 --- a/src/ImageSharp/Formats/Bmp/BmpEncoderCore.cs +++ b/src/ImageSharp/Formats/Bmp/BmpEncoderCore.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; @@ -176,7 +176,7 @@ public void Encode(Image image, Stream stream) #if NETCOREAPP2_1 Span buffer = stackalloc byte[infoHeaderSize]; #else - byte[] buffer = new byte[infoHeaderSize]; + var buffer = new byte[infoHeaderSize]; #endif fileHeader.WriteTo(buffer); diff --git a/src/ImageSharp/Formats/Gif/LzwDecoder.cs b/src/ImageSharp/Formats/Gif/LzwDecoder.cs index 07594e81a1..af390e9545 100644 --- a/src/ImageSharp/Formats/Gif/LzwDecoder.cs +++ b/src/ImageSharp/Formats/Gif/LzwDecoder.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; @@ -116,7 +116,7 @@ public void DecodePixels(int width, int height, int dataSize, Span pixels) #if NETCOREAPP2_1 Span buffer = stackalloc byte[255]; #else - byte[] buffer = new byte[255]; + var buffer = new byte[255]; #endif while (xyz < length) @@ -253,4 +253,4 @@ public void Dispose() this.pixelStack.Dispose(); } } -} \ No newline at end of file +} diff --git a/src/ImageSharp/Formats/Jpeg/Components/Block8x8.cs b/src/ImageSharp/Formats/Jpeg/Components/Block8x8.cs index 60fec25d29..0b69e3f8ba 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Block8x8.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Block8x8.cs @@ -194,7 +194,7 @@ public Block8x8F AsFloatBlock() /// public short[] ToArray() { - short[] result = new short[Size]; + var result = new short[Size]; this.CopyTo(result); return result; } @@ -297,4 +297,4 @@ public static long TotalDifference(ref Block8x8 a, ref Block8x8 b) return result; } } -} \ No newline at end of file +} diff --git a/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Generated.cs b/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Generated.cs index a9e9903a9d..23b51f0926 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Generated.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Generated.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; @@ -95,9 +95,9 @@ public void TransposeInto(ref Block8x8F d) /// public void NormalizeColorsInplace(float maximum) { - Vector4 CMin4 = new Vector4(0F); - Vector4 CMax4 = new Vector4(maximum); - Vector4 COff4 = new Vector4(MathF.Ceiling(maximum / 2)); + var CMin4 = new Vector4(0F); + var CMax4 = new Vector4(maximum); + var 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,8 +123,8 @@ public void NormalizeColorsInplace(float maximum) [MethodImpl(InliningOptions.ShortMethod)] public void NormalizeColorsAndRoundInplaceAvx2(float maximum) { - Vector off = new Vector(MathF.Ceiling(maximum / 2)); - Vector max = new Vector(maximum); + var off = new Vector(MathF.Ceiling(maximum / 2)); + var max = new Vector(maximum); ref Vector row0 = ref Unsafe.As>(ref this.V0L); row0 = NormalizeAndRound(row0, off, max); diff --git a/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Generated.tt b/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Generated.tt index d6c42a802a..176591972a 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Generated.tt +++ b/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Generated.tt @@ -1,4 +1,4 @@ -<# +<# // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. #> @@ -47,7 +47,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components char srcCoord = coordz[j % 4]; char srcSide = (j / 4) % 2 == 0 ? 'L' : 'R'; - string expression = $"d.V{j}{destSide}.{destCoord} = V{i}{srcSide}.{srcCoord};\r\n"; + var expression = $"d.V{j}{destSide}.{destCoord} = V{i}{srcSide}.{srcCoord};\r\n"; Write(expression); } } @@ -60,9 +60,9 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components /// public void NormalizeColorsInplace(float maximum) { - Vector4 CMin4 = new Vector4(0F); - Vector4 CMax4 = new Vector4(maximum); - Vector4 COff4 = new Vector4(MathF.Ceiling(maximum / 2)); + var CMin4 = new Vector4(0F); + var CMax4 = new Vector4(maximum); + var COff4 = new Vector4(MathF.Ceiling(maximum / 2)); <# @@ -86,8 +86,8 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components [MethodImpl(InliningOptions.ShortMethod)] public void NormalizeColorsAndRoundInplaceAvx2(float maximum) { - Vector off = new Vector(MathF.Ceiling(maximum / 2)); - Vector max = new Vector(maximum); + var off = new Vector(MathF.Ceiling(maximum / 2)); + var max = new Vector(maximum); <# for (int i = 0; i < 8; i++) @@ -117,7 +117,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components { char destCoord = coordz[i % 4]; char destSide = (i / 4) % 2 == 0 ? 'L' : 'R'; - + if(j > 0 && i == 0){ WriteLine(""); } @@ -125,9 +125,9 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components char srcCoord = coordz[j % 4]; char srcSide = (j / 4) % 2 == 0 ? 'L' : 'R'; - string expression = $"this.V{j}{destSide}.{destCoord} = Unsafe.Add(ref selfRef, {j*8+i});\r\n"; + var expression = $"this.V{j}{destSide}.{destCoord} = Unsafe.Add(ref selfRef, {j*8+i});\r\n"; Write(expression); - + } } PopIndent(); diff --git a/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.cs b/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.cs index 0e19d6f98b..f11b0f8fa7 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.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; @@ -257,7 +257,7 @@ public unsafe void CopyTo(Span dest) { fixed (Vector4* ptr = &this.V0L) { - float* fp = (float*)ptr; + var fp = (float*)ptr; for (int i = 0; i < Size; i++) { dest[i] = (int)fp[i]; @@ -267,7 +267,7 @@ public unsafe void CopyTo(Span dest) public float[] ToArray() { - float[] result = new float[Size]; + var result = new float[Size]; this.CopyTo(result); return result; } diff --git a/src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs b/src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs index bf7c8f9c88..c15fe5e274 100644 --- a/src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs +++ b/src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs @@ -538,7 +538,7 @@ private void ProcessApp1Marker(int remaining) return; } - byte[] profile = new byte[remaining]; + var profile = new byte[remaining]; this.InputStream.Read(profile, 0, remaining); if (ProfileResolver.IsProfile(profile, ProfileResolver.ExifMarker)) @@ -571,14 +571,14 @@ private void ProcessApp2Marker(int remaining) return; } - byte[] identifier = new byte[Icclength]; + var identifier = new byte[Icclength]; this.InputStream.Read(identifier, 0, Icclength); remaining -= Icclength; // We have read it by this point if (ProfileResolver.IsProfile(identifier, ProfileResolver.IccMarker)) { this.isIcc = true; - byte[] profile = new byte[remaining]; + var profile = new byte[remaining]; this.InputStream.Read(profile, 0, remaining); if (this.iccData is null) diff --git a/src/ImageSharp/Formats/Png/PngDecoderCore.cs b/src/ImageSharp/Formats/Png/PngDecoderCore.cs index c7ffc46a79..9bc5a5079d 100644 --- a/src/ImageSharp/Formats/Png/PngDecoderCore.cs +++ b/src/ImageSharp/Formats/Png/PngDecoderCore.cs @@ -183,12 +183,12 @@ public Image Decode(Stream stream) break; case PngChunkType.Palette: - byte[] pal = new byte[chunk.Length]; + var pal = new byte[chunk.Length]; Buffer.BlockCopy(chunk.Data.Array, 0, pal, 0, chunk.Length); this.palette = pal; break; case PngChunkType.Transparency: - byte[] alpha = new byte[chunk.Length]; + var alpha = new byte[chunk.Length]; Buffer.BlockCopy(chunk.Data.Array, 0, alpha, 0, chunk.Length); this.paletteAlpha = alpha; this.AssignTransparentMarkers(alpha, pngMetadata); @@ -205,7 +205,7 @@ public Image Decode(Stream stream) case PngChunkType.Exif: if (!this.ignoreMetadata) { - byte[] exifData = new byte[chunk.Length]; + var exifData = new byte[chunk.Length]; Buffer.BlockCopy(chunk.Data.Array, 0, exifData, 0, chunk.Length); metadata.ExifProfile = new ExifProfile(exifData); } diff --git a/src/ImageSharp/ImageFrameCollection{TPixel}.cs b/src/ImageSharp/ImageFrameCollection{TPixel}.cs index ffd7225bd4..893a7a4a80 100644 --- a/src/ImageSharp/ImageFrameCollection{TPixel}.cs +++ b/src/ImageSharp/ImageFrameCollection{TPixel}.cs @@ -347,7 +347,7 @@ internal void Dispose() private ImageFrame CopyNonCompatibleFrame(ImageFrame source) { - ImageFrame result = new ImageFrame( + var result = new ImageFrame( this.parent.GetConfiguration(), source.Size(), source.Metadata.DeepClone()); diff --git a/src/ImageSharp/MetaData/Profiles/Exif/ExifWriter.cs b/src/ImageSharp/MetaData/Profiles/Exif/ExifWriter.cs index 77af1717dd..67c1b2b65e 100644 --- a/src/ImageSharp/MetaData/Profiles/Exif/ExifWriter.cs +++ b/src/ImageSharp/MetaData/Profiles/Exif/ExifWriter.cs @@ -87,7 +87,7 @@ public byte[] GetData() length += 4 + 2; - byte[] result = new byte[length]; + var result = new byte[length]; int i = 0; diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Curves.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Curves.cs index 111911080e..58ca46d816 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Curves.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Curves.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; @@ -18,13 +18,13 @@ public IccOneDimensionalCurve ReadOneDimensionalCurve() { ushort segmentCount = this.ReadUInt16(); this.AddIndex(2); // 2 bytes reserved - float[] breakPoints = new float[segmentCount - 1]; + var breakPoints = new float[segmentCount - 1]; for (int i = 0; i < breakPoints.Length; i++) { breakPoints[i] = this.ReadSingle(); } - IccCurveSegment[] segments = new IccCurveSegment[segmentCount]; + var segments = new IccCurveSegment[segmentCount]; for (int i = 0; i < segmentCount; i++) { segments[i] = this.ReadCurveSegment(); @@ -41,19 +41,19 @@ public IccOneDimensionalCurve ReadOneDimensionalCurve() public IccResponseCurve ReadResponseCurve(int channelCount) { var type = (IccCurveMeasurementEncodings)this.ReadUInt32(); - uint[] measurement = new uint[channelCount]; + var measurement = new uint[channelCount]; for (int i = 0; i < channelCount; i++) { measurement[i] = this.ReadUInt32(); } - Vector3[] xyzValues = new Vector3[channelCount]; + var xyzValues = new Vector3[channelCount]; for (int i = 0; i < channelCount; i++) { xyzValues[i] = this.ReadXyzNumber(); } - IccResponseNumber[][] response = new IccResponseNumber[channelCount][]; + var response = new IccResponseNumber[channelCount][]; for (int i = 0; i < channelCount; i++) { response[i] = new IccResponseNumber[measurement[i]]; @@ -175,7 +175,7 @@ public IccFormulaCurveElement ReadFormulaCurveElement() public IccSampledCurveElement ReadSampledCurveElement() { uint count = this.ReadUInt32(); - float[] entries = new float[count]; + var entries = new float[count]; for (int i = 0; i < count; i++) { entries[i] = this.ReadSingle(); diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Lut.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Lut.cs index 5262e3ee95..0aa3c31e08 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Lut.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Lut.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; @@ -26,7 +26,7 @@ public IccLut ReadLut8() /// The read LUT public IccLut ReadLut16(int count) { - ushort[] values = new ushort[count]; + var values = new ushort[count]; for (int i = 0; i < count; i++) { values[i] = this.ReadUInt16(); @@ -46,7 +46,7 @@ public IccLut ReadLut16(int count) public IccClut ReadClut(int inChannelCount, int outChannelCount, bool isFloat) { // Grid-points are always 16 bytes long but only 0-inChCount are used - byte[] gridPointCount = new byte[inChannelCount]; + var gridPointCount = new byte[inChannelCount]; Buffer.BlockCopy(this.data, this.AddIndex(16), gridPointCount, 0, inChannelCount); if (!isFloat) @@ -88,7 +88,7 @@ public IccClut ReadClut8(int inChannelCount, int outChannelCount, byte[] gridPoi const float Max = byte.MaxValue; - float[][] values = new float[length][]; + var values = new float[length][]; for (int i = 0; i < length; i++) { values[i] = new float[outChannelCount]; @@ -122,7 +122,7 @@ public IccClut ReadClut16(int inChannelCount, int outChannelCount, byte[] gridPo const float Max = ushort.MaxValue; - float[][] values = new float[length][]; + var values = new float[length][]; for (int i = 0; i < length; i++) { values[i] = new float[outChannelCount]; @@ -154,7 +154,7 @@ public IccClut ReadClutF32(int inChCount, int outChCount, byte[] gridPointCount) length /= inChCount; - float[][] values = new float[length][]; + var values = new float[length][]; for (int i = 0; i < length; i++) { values[i] = new float[outChCount]; @@ -168,4 +168,4 @@ public IccClut ReadClutF32(int inChCount, int outChCount, byte[] gridPointCount) return new IccClut(values, gridPointCount, IccClutDataType.Float); } } -} \ No newline at end of file +} diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Matrix.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Matrix.cs index 3157b9ef38..ecc33dd776 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Matrix.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Matrix.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.Metadata.Profiles.Icc @@ -17,7 +17,7 @@ internal sealed partial class IccDataReader /// The read matrix public float[,] ReadMatrix(int xCount, int yCount, bool isSingle) { - float[,] matrix = new float[xCount, yCount]; + var matrix = new float[xCount, yCount]; for (int y = 0; y < yCount; y++) { for (int x = 0; x < xCount; x++) @@ -44,7 +44,7 @@ internal sealed partial class IccDataReader /// The read matrix public float[] ReadMatrix(int yCount, bool isSingle) { - float[] matrix = new float[yCount]; + var matrix = new float[yCount]; for (int i = 0; i < yCount; i++) { if (isSingle) diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.MultiProcessElement.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.MultiProcessElement.cs index 4253058288..b854247da3 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.MultiProcessElement.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.MultiProcessElement.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.Metadata.Profiles.Icc @@ -48,7 +48,7 @@ public IccMultiProcessElement ReadMultiProcessElement() /// The read public IccCurveSetProcessElement ReadCurveSetProcessElement(int inChannelCount, int outChannelCount) { - IccOneDimensionalCurve[] curves = new IccOneDimensionalCurve[inChannelCount]; + var curves = new IccOneDimensionalCurve[inChannelCount]; for (int i = 0; i < inChannelCount; i++) { curves[i] = this.ReadOneDimensionalCurve(); diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.NonPrimitives.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.NonPrimitives.cs index aacbbcc1dd..b5326225cf 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.NonPrimitives.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.NonPrimitives.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; @@ -105,7 +105,7 @@ public IccNamedColor ReadNamedColor(uint deviceCoordCount) { string name = this.ReadAsciiString(32); ushort[] pcsCoord = { this.ReadUInt16(), this.ReadUInt16(), this.ReadUInt16() }; - ushort[] deviceCoord = new ushort[deviceCoordCount]; + var deviceCoord = new ushort[deviceCoordCount]; for (int i = 0; i < deviceCoordCount; i++) { diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Primitives.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Primitives.cs index 2cbf798ec2..3f016444bd 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Primitives.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Primitives.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; @@ -165,7 +165,7 @@ public float ReadUFix8() /// The read bytes public byte[] ReadBytes(int count) { - byte[] bytes = new byte[count]; + var bytes = new byte[count]; Buffer.BlockCopy(this.data, this.AddIndex(count), bytes, 0, count); return bytes; } diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.TagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.TagDataEntry.cs index a30e45ddeb..a0ee1d5e50 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.TagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.TagDataEntry.cs @@ -153,7 +153,7 @@ public IccChromaticityTagDataEntry ReadChromaticityTagDataEntry() else { // The type is not know, so the values need be read - double[][] values = new double[channelCount][]; + var values = new double[channelCount][]; for (int i = 0; i < channelCount; i++) { values[i] = new double[] { this.ReadUFix16(), this.ReadUFix16() }; @@ -208,7 +208,7 @@ public IccCurveTagDataEntry ReadCurveTagDataEntry() return new IccCurveTagDataEntry(this.ReadUFix8()); } - float[] cdata = new float[pointCount]; + var cdata = new float[pointCount]; for (int i = 0; i < pointCount; i++) { cdata[i] = this.ReadUInt16() / 65535f; @@ -264,7 +264,7 @@ public IccLut16TagDataEntry ReadLut16TagDataEntry() // Input LUT var inValues = new IccLut[inChCount]; - byte[] gridPointCount = new byte[inChCount]; + var gridPointCount = new byte[inChCount]; for (int i = 0; i < inChCount; i++) { inValues[i] = this.ReadLut16(inTableCount); @@ -299,7 +299,7 @@ public IccLut8TagDataEntry ReadLut8TagDataEntry() // Input LUT var inValues = new IccLut[inChCount]; - byte[] gridPointCount = new byte[inChCount]; + var gridPointCount = new byte[inChCount]; for (int i = 0; i < inChCount; i++) { inValues[i] = this.ReadLut8(); @@ -464,8 +464,8 @@ public IccMultiLocalizedUnicodeTagDataEntry ReadMultiLocalizedUnicodeTagDataEntr var text = new IccLocalizedString[recordCount]; var culture = new CultureInfo[recordCount]; - uint[] length = new uint[recordCount]; - uint[] offset = new uint[recordCount]; + var length = new uint[recordCount]; + var offset = new uint[recordCount]; for (int i = 0; i < recordCount; i++) { @@ -627,7 +627,7 @@ public IccResponseCurveSet16TagDataEntry ReadResponseCurveSet16TagDataEntry() ushort channelCount = this.ReadUInt16(); ushort measurementCount = this.ReadUInt16(); - uint[] offset = new uint[measurementCount]; + var offset = new uint[measurementCount]; for (int i = 0; i < measurementCount; i++) { offset[i] = this.ReadUInt32(); @@ -651,7 +651,7 @@ public IccResponseCurveSet16TagDataEntry ReadResponseCurveSet16TagDataEntry() public IccFix16ArrayTagDataEntry ReadFix16ArrayTagDataEntry(uint size) { uint count = (size - 8) / 4; - float[] arrayData = new float[count]; + var arrayData = new float[count]; for (int i = 0; i < count; i++) { arrayData[i] = this.ReadFix16() / 256f; @@ -687,7 +687,7 @@ public IccTextTagDataEntry ReadTextTagDataEntry(uint size) public IccUFix16ArrayTagDataEntry ReadUFix16ArrayTagDataEntry(uint size) { uint count = (size - 8) / 4; - float[] arrayData = new float[count]; + var arrayData = new float[count]; for (int i = 0; i < count; i++) { arrayData[i] = this.ReadUFix16(); @@ -704,7 +704,7 @@ public IccUFix16ArrayTagDataEntry ReadUFix16ArrayTagDataEntry(uint size) public IccUInt16ArrayTagDataEntry ReadUInt16ArrayTagDataEntry(uint size) { uint count = (size - 8) / 2; - ushort[] arrayData = new ushort[count]; + var arrayData = new ushort[count]; for (int i = 0; i < count; i++) { arrayData[i] = this.ReadUInt16(); @@ -721,7 +721,7 @@ public IccUInt16ArrayTagDataEntry ReadUInt16ArrayTagDataEntry(uint size) public IccUInt32ArrayTagDataEntry ReadUInt32ArrayTagDataEntry(uint size) { uint count = (size - 8) / 4; - uint[] arrayData = new uint[count]; + var arrayData = new uint[count]; for (int i = 0; i < count; i++) { arrayData[i] = this.ReadUInt32(); @@ -738,7 +738,7 @@ public IccUInt32ArrayTagDataEntry ReadUInt32ArrayTagDataEntry(uint size) public IccUInt64ArrayTagDataEntry ReadUInt64ArrayTagDataEntry(uint size) { uint count = (size - 8) / 8; - ulong[] arrayData = new ulong[count]; + var arrayData = new ulong[count]; for (int i = 0; i < count; i++) { arrayData[i] = this.ReadUInt64(); @@ -878,14 +878,14 @@ public IccScreeningTagDataEntry ReadScreeningTagDataEntry() public IccUcrBgTagDataEntry ReadUcrBgTagDataEntry(uint size) { uint ucrCount = this.ReadUInt32(); - ushort[] ucrCurve = new ushort[ucrCount]; + var ucrCurve = new ushort[ucrCount]; for (int i = 0; i < ucrCurve.Length; i++) { ucrCurve[i] = this.ReadUInt16(); } uint bgCount = this.ReadUInt32(); - ushort[] bgCurve = new ushort[bgCount]; + var bgCurve = new ushort[bgCount]; for (int i = 0; i < bgCurve.Length; i++) { bgCurve[i] = this.ReadUInt16(); diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.TagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.TagDataEntry.cs index 18f3fa15aa..b761f48ba0 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.TagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.TagDataEntry.cs @@ -560,8 +560,8 @@ public int WriteMultiLocalizedUnicodeTagDataEntry(IccMultiLocalizedUnicodeTagDat // TODO: Investigate cost of Linq GroupBy IGrouping[] texts = value.Texts.GroupBy(t => t.Text).ToArray(); - uint[] offset = new uint[texts.Length]; - int[] lengths = new int[texts.Length]; + var offset = new uint[texts.Length]; + var lengths = new int[texts.Length]; for (int i = 0; i < texts.Length; i++) { @@ -746,7 +746,7 @@ public int WriteResponseCurveSet16TagDataEntry(IccResponseCurveSet16TagDataEntry long tablePosition = this.dataStream.Position; this.dataStream.Position += value.Curves.Length * 4; - uint[] offset = new uint[value.Curves.Length]; + var offset = new uint[value.Curves.Length]; for (int i = 0; i < value.Curves.Length; i++) { diff --git a/src/ImageSharp/MetaData/Profiles/ICC/IccProfile.cs b/src/ImageSharp/MetaData/Profiles/ICC/IccProfile.cs index afdd7ebfb5..7c5139475b 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/IccProfile.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/IccProfile.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; @@ -108,7 +108,7 @@ public static IccProfileId CalculateHash(byte[] data) const int profileIdPos = 84; // need to copy some values because they need to be zero for the hashing - byte[] temp = new byte[24]; + var temp = new byte[24]; Buffer.BlockCopy(data, profileFlagPos, temp, 0, 4); Buffer.BlockCopy(data, renderingIntentPos, temp, 4, 4); Buffer.BlockCopy(data, profileIdPos, temp, 8, 16); @@ -171,7 +171,7 @@ public byte[] ToByteArray() { if (this.data != null) { - byte[] copy = new byte[this.data.Length]; + var copy = new byte[this.data.Length]; Buffer.BlockCopy(this.data, 0, copy, 0, copy.Length); return copy; } @@ -216,4 +216,4 @@ private void InitializeEntries() this.entries = reader.ReadTagData(this.data); } } -} \ No newline at end of file +} diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccTextDescriptionTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccTextDescriptionTagDataEntry.cs index 4134779c3c..23e81fe993 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccTextDescriptionTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccTextDescriptionTagDataEntry.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; @@ -122,7 +122,7 @@ CultureInfo GetCulture(uint value) && p3 >= 0x41 && p3 <= 0x5A && p4 >= 0x41 && p4 <= 0x5A) { - string culture = new string(new[] { (char)p1, (char)p2, '-', (char)p3, (char)p4 }); + var culture = new string(new[] { (char)p1, (char)p2, '-', (char)p3, (char)p4 }); return new CultureInfo(culture); } @@ -175,4 +175,4 @@ public override int GetHashCode() this.ScriptCodeCode); } } -} \ No newline at end of file +} diff --git a/src/ImageSharp/PixelFormats/PixelBlenders/DefaultPixelBlenders.Generated.cs b/src/ImageSharp/PixelFormats/PixelBlenders/DefaultPixelBlenders.Generated.cs index 0cf8d6bbbf..e94ea452be 100644 --- a/src/ImageSharp/PixelFormats/PixelBlenders/DefaultPixelBlenders.Generated.cs +++ b/src/ImageSharp/PixelFormats/PixelBlenders/DefaultPixelBlenders.Generated.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. // @@ -38,26 +38,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.NormalSrc(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.NormalSrc(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.NormalSrc(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -73,26 +73,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.MultiplySrc(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.MultiplySrc(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.MultiplySrc(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -108,26 +108,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.AddSrc(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.AddSrc(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.AddSrc(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -143,26 +143,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.SubtractSrc(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.SubtractSrc(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.SubtractSrc(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -178,26 +178,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.ScreenSrc(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.ScreenSrc(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.ScreenSrc(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -213,26 +213,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.DarkenSrc(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.DarkenSrc(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.DarkenSrc(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -248,26 +248,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.LightenSrc(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.LightenSrc(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.LightenSrc(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -283,26 +283,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.OverlaySrc(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.OverlaySrc(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.OverlaySrc(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -318,26 +318,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.HardLightSrc(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.HardLightSrc(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.HardLightSrc(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -353,26 +353,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.NormalSrcAtop(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.NormalSrcAtop(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.NormalSrcAtop(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -388,26 +388,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.MultiplySrcAtop(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.MultiplySrcAtop(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.MultiplySrcAtop(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -423,26 +423,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.AddSrcAtop(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.AddSrcAtop(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.AddSrcAtop(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -458,26 +458,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.SubtractSrcAtop(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.SubtractSrcAtop(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.SubtractSrcAtop(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -493,26 +493,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.ScreenSrcAtop(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.ScreenSrcAtop(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.ScreenSrcAtop(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -528,26 +528,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.DarkenSrcAtop(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.DarkenSrcAtop(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.DarkenSrcAtop(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -563,26 +563,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.LightenSrcAtop(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.LightenSrcAtop(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.LightenSrcAtop(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -598,26 +598,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.OverlaySrcAtop(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.OverlaySrcAtop(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.OverlaySrcAtop(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -633,26 +633,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.HardLightSrcAtop(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.HardLightSrcAtop(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.HardLightSrcAtop(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -668,26 +668,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.NormalSrcOver(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.NormalSrcOver(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.NormalSrcOver(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -703,26 +703,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.MultiplySrcOver(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.MultiplySrcOver(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.MultiplySrcOver(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -738,26 +738,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.AddSrcOver(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.AddSrcOver(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.AddSrcOver(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -773,26 +773,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.SubtractSrcOver(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.SubtractSrcOver(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.SubtractSrcOver(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -808,26 +808,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.ScreenSrcOver(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.ScreenSrcOver(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.ScreenSrcOver(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -843,26 +843,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.DarkenSrcOver(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.DarkenSrcOver(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.DarkenSrcOver(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -878,26 +878,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.LightenSrcOver(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.LightenSrcOver(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.LightenSrcOver(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -913,26 +913,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.OverlaySrcOver(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.OverlaySrcOver(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.OverlaySrcOver(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -948,26 +948,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.HardLightSrcOver(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.HardLightSrcOver(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.HardLightSrcOver(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -983,26 +983,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.NormalSrcIn(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.NormalSrcIn(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.NormalSrcIn(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -1018,26 +1018,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.MultiplySrcIn(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.MultiplySrcIn(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.MultiplySrcIn(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -1053,26 +1053,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.AddSrcIn(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.AddSrcIn(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.AddSrcIn(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -1088,26 +1088,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.SubtractSrcIn(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.SubtractSrcIn(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.SubtractSrcIn(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -1123,26 +1123,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.ScreenSrcIn(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.ScreenSrcIn(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.ScreenSrcIn(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -1158,26 +1158,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.DarkenSrcIn(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.DarkenSrcIn(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.DarkenSrcIn(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -1193,26 +1193,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.LightenSrcIn(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.LightenSrcIn(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.LightenSrcIn(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -1228,26 +1228,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.OverlaySrcIn(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.OverlaySrcIn(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.OverlaySrcIn(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -1263,26 +1263,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.HardLightSrcIn(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.HardLightSrcIn(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.HardLightSrcIn(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -1298,26 +1298,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.NormalSrcOut(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.NormalSrcOut(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.NormalSrcOut(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -1333,26 +1333,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.MultiplySrcOut(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.MultiplySrcOut(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.MultiplySrcOut(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -1368,26 +1368,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.AddSrcOut(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.AddSrcOut(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.AddSrcOut(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -1403,26 +1403,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.SubtractSrcOut(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.SubtractSrcOut(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.SubtractSrcOut(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -1438,26 +1438,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.ScreenSrcOut(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.ScreenSrcOut(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.ScreenSrcOut(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -1473,26 +1473,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.DarkenSrcOut(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.DarkenSrcOut(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.DarkenSrcOut(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -1508,26 +1508,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.LightenSrcOut(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.LightenSrcOut(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.LightenSrcOut(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -1543,26 +1543,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.OverlaySrcOut(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.OverlaySrcOut(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.OverlaySrcOut(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -1578,26 +1578,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.HardLightSrcOut(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.HardLightSrcOut(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.HardLightSrcOut(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -1613,26 +1613,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.NormalDest(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.NormalDest(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.NormalDest(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -1648,26 +1648,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.MultiplyDest(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.MultiplyDest(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.MultiplyDest(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -1683,26 +1683,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.AddDest(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.AddDest(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.AddDest(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -1718,26 +1718,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.SubtractDest(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.SubtractDest(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.SubtractDest(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -1753,26 +1753,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.ScreenDest(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.ScreenDest(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.ScreenDest(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -1788,26 +1788,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.DarkenDest(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.DarkenDest(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.DarkenDest(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -1823,26 +1823,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.LightenDest(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.LightenDest(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.LightenDest(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -1858,26 +1858,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.OverlayDest(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.OverlayDest(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.OverlayDest(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -1893,26 +1893,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.HardLightDest(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.HardLightDest(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.HardLightDest(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -1928,26 +1928,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.NormalDestAtop(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.NormalDestAtop(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.NormalDestAtop(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -1963,26 +1963,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.MultiplyDestAtop(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.MultiplyDestAtop(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.MultiplyDestAtop(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -1998,26 +1998,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.AddDestAtop(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.AddDestAtop(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.AddDestAtop(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -2033,26 +2033,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.SubtractDestAtop(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.SubtractDestAtop(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.SubtractDestAtop(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -2068,26 +2068,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.ScreenDestAtop(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.ScreenDestAtop(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.ScreenDestAtop(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -2103,26 +2103,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.DarkenDestAtop(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.DarkenDestAtop(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.DarkenDestAtop(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -2138,26 +2138,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.LightenDestAtop(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.LightenDestAtop(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.LightenDestAtop(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -2173,26 +2173,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.OverlayDestAtop(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.OverlayDestAtop(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.OverlayDestAtop(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -2208,26 +2208,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.HardLightDestAtop(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.HardLightDestAtop(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.HardLightDestAtop(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -2243,26 +2243,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.NormalDestOver(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.NormalDestOver(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.NormalDestOver(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -2278,26 +2278,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.MultiplyDestOver(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.MultiplyDestOver(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.MultiplyDestOver(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -2313,26 +2313,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.AddDestOver(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.AddDestOver(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.AddDestOver(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -2348,26 +2348,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.SubtractDestOver(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.SubtractDestOver(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.SubtractDestOver(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -2383,26 +2383,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.ScreenDestOver(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.ScreenDestOver(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.ScreenDestOver(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -2418,26 +2418,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.DarkenDestOver(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.DarkenDestOver(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.DarkenDestOver(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -2453,26 +2453,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.LightenDestOver(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.LightenDestOver(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.LightenDestOver(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -2488,26 +2488,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.OverlayDestOver(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.OverlayDestOver(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.OverlayDestOver(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -2523,26 +2523,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.HardLightDestOver(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.HardLightDestOver(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.HardLightDestOver(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -2558,26 +2558,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.NormalDestIn(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.NormalDestIn(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.NormalDestIn(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -2593,26 +2593,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.MultiplyDestIn(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.MultiplyDestIn(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.MultiplyDestIn(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -2628,26 +2628,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.AddDestIn(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.AddDestIn(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.AddDestIn(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -2663,26 +2663,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.SubtractDestIn(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.SubtractDestIn(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.SubtractDestIn(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -2698,26 +2698,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.ScreenDestIn(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.ScreenDestIn(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.ScreenDestIn(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -2733,26 +2733,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.DarkenDestIn(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.DarkenDestIn(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.DarkenDestIn(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -2768,26 +2768,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.LightenDestIn(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.LightenDestIn(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.LightenDestIn(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -2803,26 +2803,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.OverlayDestIn(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.OverlayDestIn(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.OverlayDestIn(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -2838,26 +2838,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.HardLightDestIn(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.HardLightDestIn(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.HardLightDestIn(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -2873,26 +2873,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.NormalDestOut(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.NormalDestOut(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.NormalDestOut(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -2908,26 +2908,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.MultiplyDestOut(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.MultiplyDestOut(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.MultiplyDestOut(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -2943,26 +2943,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.AddDestOut(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.AddDestOut(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.AddDestOut(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -2978,26 +2978,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.SubtractDestOut(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.SubtractDestOut(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.SubtractDestOut(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -3013,26 +3013,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.ScreenDestOut(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.ScreenDestOut(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.ScreenDestOut(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -3048,26 +3048,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.DarkenDestOut(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.DarkenDestOut(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.DarkenDestOut(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -3083,26 +3083,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.LightenDestOut(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.LightenDestOut(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.LightenDestOut(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -3118,26 +3118,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.OverlayDestOut(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.OverlayDestOut(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.OverlayDestOut(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -3153,26 +3153,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.HardLightDestOut(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.HardLightDestOut(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.HardLightDestOut(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -3188,26 +3188,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.NormalClear(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.NormalClear(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.NormalClear(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -3223,26 +3223,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.MultiplyClear(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.MultiplyClear(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.MultiplyClear(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -3258,26 +3258,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.AddClear(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.AddClear(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.AddClear(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -3293,26 +3293,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.SubtractClear(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.SubtractClear(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.SubtractClear(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -3328,26 +3328,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.ScreenClear(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.ScreenClear(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.ScreenClear(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -3363,26 +3363,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.DarkenClear(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.DarkenClear(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.DarkenClear(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -3398,26 +3398,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.LightenClear(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.LightenClear(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.LightenClear(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -3433,26 +3433,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.OverlayClear(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.OverlayClear(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.OverlayClear(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -3468,26 +3468,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.HardLightClear(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.HardLightClear(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.HardLightClear(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -3503,26 +3503,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.NormalXor(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.NormalXor(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.NormalXor(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -3538,26 +3538,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.MultiplyXor(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.MultiplyXor(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.MultiplyXor(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -3573,26 +3573,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.AddXor(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.AddXor(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.AddXor(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -3608,26 +3608,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.SubtractXor(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.SubtractXor(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.SubtractXor(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -3643,26 +3643,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.ScreenXor(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.ScreenXor(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.ScreenXor(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -3678,26 +3678,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.DarkenXor(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.DarkenXor(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.DarkenXor(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -3713,26 +3713,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.LightenXor(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.LightenXor(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.LightenXor(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -3748,26 +3748,26 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.OverlayXor(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.OverlayXor(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.OverlayXor(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -3783,28 +3783,28 @@ public override TPixel Blend(TPixel background, TPixel source, float amount) { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.HardLightXor(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.HardLightXor(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.HardLightXor(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } } -} \ No newline at end of file +} diff --git a/src/ImageSharp/PixelFormats/PixelBlenders/DefaultPixelBlenders.Generated.tt b/src/ImageSharp/PixelFormats/PixelBlenders/DefaultPixelBlenders.Generated.tt index 2cca55e4c3..66a00975e1 100644 --- a/src/ImageSharp/PixelFormats/PixelBlenders/DefaultPixelBlenders.Generated.tt +++ b/src/ImageSharp/PixelFormats/PixelBlenders/DefaultPixelBlenders.Generated.tt @@ -1,4 +1,4 @@ -<# +<# // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. #> @@ -37,7 +37,7 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders { <# - string[] composers = new []{ + var composers = new []{ "Src", "SrcAtop", "SrcOver", @@ -52,7 +52,7 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders "Xor", }; - string[] blenders = new []{ + var blenders = new []{ "Normal", "Multiply", "Add", @@ -67,7 +67,7 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders foreach(var composer in composers) { foreach(var blender in blenders) { - string blender_composer= $"{blender}{composer}"; + var blender_composer= $"{blender}{composer}"; #> internal class <#= blender_composer#> : PixelBlender @@ -82,26 +82,26 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders { TPixel dest = default; dest.FromScaledVector4(PorterDuffFunctions.<#=blender_composer#>(background.ToScaledVector4(), source.ToScaledVector4(), amount.Clamp(0, 1))); - return dest; + return dest; } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, float amount) { amount = amount.Clamp(0, 1); for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.<#=blender_composer#>(background[i], source[i], amount); - } + } } /// - protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) + protected override void BlendFunction(Span destination, ReadOnlySpan background, ReadOnlySpan source, ReadOnlySpan amount) { for (int i = 0; i < destination.Length; i++) { destination[i] = PorterDuffFunctions.<#=blender_composer#>(background[i], source[i], amount[i].Clamp(0, 1)); - } + } } } @@ -111,4 +111,4 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders #> } -} \ No newline at end of file +} diff --git a/src/ImageSharp/PixelFormats/PixelBlenders/PorterDuffFunctions.Generated.cs b/src/ImageSharp/PixelFormats/PixelBlenders/PorterDuffFunctions.Generated.cs index a99deb535a..8b92f95c36 100644 --- a/src/ImageSharp/PixelFormats/PixelBlenders/PorterDuffFunctions.Generated.cs +++ b/src/ImageSharp/PixelFormats/PixelBlenders/PorterDuffFunctions.Generated.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. // @@ -101,7 +101,7 @@ public static Vector4 NormalXor(Vector4 backdrop, Vector4 source, float opacity) source.W *= opacity; return Xor(backdrop, source); - } + } [MethodImpl(MethodImplOptions.NoInlining)] public static Vector4 NormalClear(Vector4 backdrop, Vector4 source, float opacity) @@ -110,7 +110,6 @@ public static Vector4 NormalClear(Vector4 backdrop, Vector4 source, float opacit return Clear(backdrop, source); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel NormalSrc(TPixel backdrop, TPixel source, float opacity) @@ -122,7 +121,6 @@ public static TPixel NormalSrc(TPixel backdrop, TPixel source, float opa return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel NormalSrcAtop(TPixel backdrop, TPixel source, float opacity) @@ -134,7 +132,6 @@ public static TPixel NormalSrcAtop(TPixel backdrop, TPixel source, float return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel NormalSrcOver(TPixel backdrop, TPixel source, float opacity) @@ -146,7 +143,6 @@ public static TPixel NormalSrcOver(TPixel backdrop, TPixel source, float return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel NormalSrcIn(TPixel backdrop, TPixel source, float opacity) @@ -158,7 +154,6 @@ public static TPixel NormalSrcIn(TPixel backdrop, TPixel source, float o return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel NormalSrcOut(TPixel backdrop, TPixel source, float opacity) @@ -170,7 +165,6 @@ public static TPixel NormalSrcOut(TPixel backdrop, TPixel source, float return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel NormalDest(TPixel backdrop, TPixel source, float opacity) @@ -182,7 +176,6 @@ public static TPixel NormalDest(TPixel backdrop, TPixel source, float op return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel NormalDestAtop(TPixel backdrop, TPixel source, float opacity) @@ -194,7 +187,6 @@ public static TPixel NormalDestAtop(TPixel backdrop, TPixel source, floa return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel NormalDestOver(TPixel backdrop, TPixel source, float opacity) @@ -206,7 +198,6 @@ public static TPixel NormalDestOver(TPixel backdrop, TPixel source, floa return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel NormalDestIn(TPixel backdrop, TPixel source, float opacity) @@ -218,7 +209,6 @@ public static TPixel NormalDestIn(TPixel backdrop, TPixel source, float return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel NormalDestOut(TPixel backdrop, TPixel source, float opacity) @@ -230,7 +220,6 @@ public static TPixel NormalDestOut(TPixel backdrop, TPixel source, float return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel NormalClear(TPixel backdrop, TPixel source, float opacity) @@ -242,7 +231,6 @@ public static TPixel NormalClear(TPixel backdrop, TPixel source, float o return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel NormalXor(TPixel backdrop, TPixel source, float opacity) @@ -339,7 +327,7 @@ public static Vector4 MultiplyXor(Vector4 backdrop, Vector4 source, float opacit source.W *= opacity; return Xor(backdrop, source); - } + } [MethodImpl(MethodImplOptions.NoInlining)] public static Vector4 MultiplyClear(Vector4 backdrop, Vector4 source, float opacity) @@ -348,7 +336,6 @@ public static Vector4 MultiplyClear(Vector4 backdrop, Vector4 source, float opac return Clear(backdrop, source); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel MultiplySrc(TPixel backdrop, TPixel source, float opacity) @@ -360,7 +347,6 @@ public static TPixel MultiplySrc(TPixel backdrop, TPixel source, float o return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel MultiplySrcAtop(TPixel backdrop, TPixel source, float opacity) @@ -372,7 +358,6 @@ public static TPixel MultiplySrcAtop(TPixel backdrop, TPixel source, flo return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel MultiplySrcOver(TPixel backdrop, TPixel source, float opacity) @@ -384,7 +369,6 @@ public static TPixel MultiplySrcOver(TPixel backdrop, TPixel source, flo return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel MultiplySrcIn(TPixel backdrop, TPixel source, float opacity) @@ -396,7 +380,6 @@ public static TPixel MultiplySrcIn(TPixel backdrop, TPixel source, float return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel MultiplySrcOut(TPixel backdrop, TPixel source, float opacity) @@ -408,7 +391,6 @@ public static TPixel MultiplySrcOut(TPixel backdrop, TPixel source, floa return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel MultiplyDest(TPixel backdrop, TPixel source, float opacity) @@ -420,7 +402,6 @@ public static TPixel MultiplyDest(TPixel backdrop, TPixel source, float return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel MultiplyDestAtop(TPixel backdrop, TPixel source, float opacity) @@ -432,7 +413,6 @@ public static TPixel MultiplyDestAtop(TPixel backdrop, TPixel source, fl return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel MultiplyDestOver(TPixel backdrop, TPixel source, float opacity) @@ -444,7 +424,6 @@ public static TPixel MultiplyDestOver(TPixel backdrop, TPixel source, fl return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel MultiplyDestIn(TPixel backdrop, TPixel source, float opacity) @@ -456,7 +435,6 @@ public static TPixel MultiplyDestIn(TPixel backdrop, TPixel source, floa return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel MultiplyDestOut(TPixel backdrop, TPixel source, float opacity) @@ -468,7 +446,6 @@ public static TPixel MultiplyDestOut(TPixel backdrop, TPixel source, flo return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel MultiplyClear(TPixel backdrop, TPixel source, float opacity) @@ -480,7 +457,6 @@ public static TPixel MultiplyClear(TPixel backdrop, TPixel source, float return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel MultiplyXor(TPixel backdrop, TPixel source, float opacity) @@ -577,7 +553,7 @@ public static Vector4 AddXor(Vector4 backdrop, Vector4 source, float opacity) source.W *= opacity; return Xor(backdrop, source); - } + } [MethodImpl(MethodImplOptions.NoInlining)] public static Vector4 AddClear(Vector4 backdrop, Vector4 source, float opacity) @@ -586,7 +562,6 @@ public static Vector4 AddClear(Vector4 backdrop, Vector4 source, float opacity) return Clear(backdrop, source); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel AddSrc(TPixel backdrop, TPixel source, float opacity) @@ -598,7 +573,6 @@ public static TPixel AddSrc(TPixel backdrop, TPixel source, float opacit return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel AddSrcAtop(TPixel backdrop, TPixel source, float opacity) @@ -610,7 +584,6 @@ public static TPixel AddSrcAtop(TPixel backdrop, TPixel source, float op return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel AddSrcOver(TPixel backdrop, TPixel source, float opacity) @@ -622,7 +595,6 @@ public static TPixel AddSrcOver(TPixel backdrop, TPixel source, float op return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel AddSrcIn(TPixel backdrop, TPixel source, float opacity) @@ -634,7 +606,6 @@ public static TPixel AddSrcIn(TPixel backdrop, TPixel source, float opac return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel AddSrcOut(TPixel backdrop, TPixel source, float opacity) @@ -646,7 +617,6 @@ public static TPixel AddSrcOut(TPixel backdrop, TPixel source, float opa return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel AddDest(TPixel backdrop, TPixel source, float opacity) @@ -658,7 +628,6 @@ public static TPixel AddDest(TPixel backdrop, TPixel source, float opaci return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel AddDestAtop(TPixel backdrop, TPixel source, float opacity) @@ -670,7 +639,6 @@ public static TPixel AddDestAtop(TPixel backdrop, TPixel source, float o return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel AddDestOver(TPixel backdrop, TPixel source, float opacity) @@ -682,7 +650,6 @@ public static TPixel AddDestOver(TPixel backdrop, TPixel source, float o return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel AddDestIn(TPixel backdrop, TPixel source, float opacity) @@ -694,7 +661,6 @@ public static TPixel AddDestIn(TPixel backdrop, TPixel source, float opa return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel AddDestOut(TPixel backdrop, TPixel source, float opacity) @@ -706,7 +672,6 @@ public static TPixel AddDestOut(TPixel backdrop, TPixel source, float op return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel AddClear(TPixel backdrop, TPixel source, float opacity) @@ -718,7 +683,6 @@ public static TPixel AddClear(TPixel backdrop, TPixel source, float opac return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel AddXor(TPixel backdrop, TPixel source, float opacity) @@ -815,7 +779,7 @@ public static Vector4 SubtractXor(Vector4 backdrop, Vector4 source, float opacit source.W *= opacity; return Xor(backdrop, source); - } + } [MethodImpl(MethodImplOptions.NoInlining)] public static Vector4 SubtractClear(Vector4 backdrop, Vector4 source, float opacity) @@ -824,7 +788,6 @@ public static Vector4 SubtractClear(Vector4 backdrop, Vector4 source, float opac return Clear(backdrop, source); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel SubtractSrc(TPixel backdrop, TPixel source, float opacity) @@ -836,7 +799,6 @@ public static TPixel SubtractSrc(TPixel backdrop, TPixel source, float o return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel SubtractSrcAtop(TPixel backdrop, TPixel source, float opacity) @@ -848,7 +810,6 @@ public static TPixel SubtractSrcAtop(TPixel backdrop, TPixel source, flo return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel SubtractSrcOver(TPixel backdrop, TPixel source, float opacity) @@ -860,7 +821,6 @@ public static TPixel SubtractSrcOver(TPixel backdrop, TPixel source, flo return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel SubtractSrcIn(TPixel backdrop, TPixel source, float opacity) @@ -872,7 +832,6 @@ public static TPixel SubtractSrcIn(TPixel backdrop, TPixel source, float return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel SubtractSrcOut(TPixel backdrop, TPixel source, float opacity) @@ -884,7 +843,6 @@ public static TPixel SubtractSrcOut(TPixel backdrop, TPixel source, floa return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel SubtractDest(TPixel backdrop, TPixel source, float opacity) @@ -896,7 +854,6 @@ public static TPixel SubtractDest(TPixel backdrop, TPixel source, float return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel SubtractDestAtop(TPixel backdrop, TPixel source, float opacity) @@ -908,7 +865,6 @@ public static TPixel SubtractDestAtop(TPixel backdrop, TPixel source, fl return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel SubtractDestOver(TPixel backdrop, TPixel source, float opacity) @@ -920,7 +876,6 @@ public static TPixel SubtractDestOver(TPixel backdrop, TPixel source, fl return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel SubtractDestIn(TPixel backdrop, TPixel source, float opacity) @@ -932,7 +887,6 @@ public static TPixel SubtractDestIn(TPixel backdrop, TPixel source, floa return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel SubtractDestOut(TPixel backdrop, TPixel source, float opacity) @@ -944,7 +898,6 @@ public static TPixel SubtractDestOut(TPixel backdrop, TPixel source, flo return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel SubtractClear(TPixel backdrop, TPixel source, float opacity) @@ -956,7 +909,6 @@ public static TPixel SubtractClear(TPixel backdrop, TPixel source, float return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel SubtractXor(TPixel backdrop, TPixel source, float opacity) @@ -1053,7 +1005,7 @@ public static Vector4 ScreenXor(Vector4 backdrop, Vector4 source, float opacity) source.W *= opacity; return Xor(backdrop, source); - } + } [MethodImpl(MethodImplOptions.NoInlining)] public static Vector4 ScreenClear(Vector4 backdrop, Vector4 source, float opacity) @@ -1062,7 +1014,6 @@ public static Vector4 ScreenClear(Vector4 backdrop, Vector4 source, float opacit return Clear(backdrop, source); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel ScreenSrc(TPixel backdrop, TPixel source, float opacity) @@ -1074,7 +1025,6 @@ public static TPixel ScreenSrc(TPixel backdrop, TPixel source, float opa return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel ScreenSrcAtop(TPixel backdrop, TPixel source, float opacity) @@ -1086,7 +1036,6 @@ public static TPixel ScreenSrcAtop(TPixel backdrop, TPixel source, float return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel ScreenSrcOver(TPixel backdrop, TPixel source, float opacity) @@ -1098,7 +1047,6 @@ public static TPixel ScreenSrcOver(TPixel backdrop, TPixel source, float return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel ScreenSrcIn(TPixel backdrop, TPixel source, float opacity) @@ -1110,7 +1058,6 @@ public static TPixel ScreenSrcIn(TPixel backdrop, TPixel source, float o return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel ScreenSrcOut(TPixel backdrop, TPixel source, float opacity) @@ -1122,7 +1069,6 @@ public static TPixel ScreenSrcOut(TPixel backdrop, TPixel source, float return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel ScreenDest(TPixel backdrop, TPixel source, float opacity) @@ -1134,7 +1080,6 @@ public static TPixel ScreenDest(TPixel backdrop, TPixel source, float op return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel ScreenDestAtop(TPixel backdrop, TPixel source, float opacity) @@ -1146,7 +1091,6 @@ public static TPixel ScreenDestAtop(TPixel backdrop, TPixel source, floa return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel ScreenDestOver(TPixel backdrop, TPixel source, float opacity) @@ -1158,7 +1102,6 @@ public static TPixel ScreenDestOver(TPixel backdrop, TPixel source, floa return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel ScreenDestIn(TPixel backdrop, TPixel source, float opacity) @@ -1170,7 +1113,6 @@ public static TPixel ScreenDestIn(TPixel backdrop, TPixel source, float return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel ScreenDestOut(TPixel backdrop, TPixel source, float opacity) @@ -1182,7 +1124,6 @@ public static TPixel ScreenDestOut(TPixel backdrop, TPixel source, float return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel ScreenClear(TPixel backdrop, TPixel source, float opacity) @@ -1194,7 +1135,6 @@ public static TPixel ScreenClear(TPixel backdrop, TPixel source, float o return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel ScreenXor(TPixel backdrop, TPixel source, float opacity) @@ -1291,7 +1231,7 @@ public static Vector4 DarkenXor(Vector4 backdrop, Vector4 source, float opacity) source.W *= opacity; return Xor(backdrop, source); - } + } [MethodImpl(MethodImplOptions.NoInlining)] public static Vector4 DarkenClear(Vector4 backdrop, Vector4 source, float opacity) @@ -1300,7 +1240,6 @@ public static Vector4 DarkenClear(Vector4 backdrop, Vector4 source, float opacit return Clear(backdrop, source); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel DarkenSrc(TPixel backdrop, TPixel source, float opacity) @@ -1312,7 +1251,6 @@ public static TPixel DarkenSrc(TPixel backdrop, TPixel source, float opa return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel DarkenSrcAtop(TPixel backdrop, TPixel source, float opacity) @@ -1324,7 +1262,6 @@ public static TPixel DarkenSrcAtop(TPixel backdrop, TPixel source, float return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel DarkenSrcOver(TPixel backdrop, TPixel source, float opacity) @@ -1336,7 +1273,6 @@ public static TPixel DarkenSrcOver(TPixel backdrop, TPixel source, float return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel DarkenSrcIn(TPixel backdrop, TPixel source, float opacity) @@ -1348,7 +1284,6 @@ public static TPixel DarkenSrcIn(TPixel backdrop, TPixel source, float o return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel DarkenSrcOut(TPixel backdrop, TPixel source, float opacity) @@ -1360,7 +1295,6 @@ public static TPixel DarkenSrcOut(TPixel backdrop, TPixel source, float return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel DarkenDest(TPixel backdrop, TPixel source, float opacity) @@ -1372,7 +1306,6 @@ public static TPixel DarkenDest(TPixel backdrop, TPixel source, float op return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel DarkenDestAtop(TPixel backdrop, TPixel source, float opacity) @@ -1384,7 +1317,6 @@ public static TPixel DarkenDestAtop(TPixel backdrop, TPixel source, floa return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel DarkenDestOver(TPixel backdrop, TPixel source, float opacity) @@ -1396,7 +1328,6 @@ public static TPixel DarkenDestOver(TPixel backdrop, TPixel source, floa return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel DarkenDestIn(TPixel backdrop, TPixel source, float opacity) @@ -1408,7 +1339,6 @@ public static TPixel DarkenDestIn(TPixel backdrop, TPixel source, float return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel DarkenDestOut(TPixel backdrop, TPixel source, float opacity) @@ -1420,7 +1350,6 @@ public static TPixel DarkenDestOut(TPixel backdrop, TPixel source, float return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel DarkenClear(TPixel backdrop, TPixel source, float opacity) @@ -1432,7 +1361,6 @@ public static TPixel DarkenClear(TPixel backdrop, TPixel source, float o return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel DarkenXor(TPixel backdrop, TPixel source, float opacity) @@ -1529,7 +1457,7 @@ public static Vector4 LightenXor(Vector4 backdrop, Vector4 source, float opacity source.W *= opacity; return Xor(backdrop, source); - } + } [MethodImpl(MethodImplOptions.NoInlining)] public static Vector4 LightenClear(Vector4 backdrop, Vector4 source, float opacity) @@ -1538,7 +1466,6 @@ public static Vector4 LightenClear(Vector4 backdrop, Vector4 source, float opaci return Clear(backdrop, source); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel LightenSrc(TPixel backdrop, TPixel source, float opacity) @@ -1550,7 +1477,6 @@ public static TPixel LightenSrc(TPixel backdrop, TPixel source, float op return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel LightenSrcAtop(TPixel backdrop, TPixel source, float opacity) @@ -1562,7 +1488,6 @@ public static TPixel LightenSrcAtop(TPixel backdrop, TPixel source, floa return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel LightenSrcOver(TPixel backdrop, TPixel source, float opacity) @@ -1574,7 +1499,6 @@ public static TPixel LightenSrcOver(TPixel backdrop, TPixel source, floa return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel LightenSrcIn(TPixel backdrop, TPixel source, float opacity) @@ -1586,7 +1510,6 @@ public static TPixel LightenSrcIn(TPixel backdrop, TPixel source, float return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel LightenSrcOut(TPixel backdrop, TPixel source, float opacity) @@ -1598,7 +1521,6 @@ public static TPixel LightenSrcOut(TPixel backdrop, TPixel source, float return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel LightenDest(TPixel backdrop, TPixel source, float opacity) @@ -1610,7 +1532,6 @@ public static TPixel LightenDest(TPixel backdrop, TPixel source, float o return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel LightenDestAtop(TPixel backdrop, TPixel source, float opacity) @@ -1622,7 +1543,6 @@ public static TPixel LightenDestAtop(TPixel backdrop, TPixel source, flo return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel LightenDestOver(TPixel backdrop, TPixel source, float opacity) @@ -1634,7 +1554,6 @@ public static TPixel LightenDestOver(TPixel backdrop, TPixel source, flo return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel LightenDestIn(TPixel backdrop, TPixel source, float opacity) @@ -1646,7 +1565,6 @@ public static TPixel LightenDestIn(TPixel backdrop, TPixel source, float return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel LightenDestOut(TPixel backdrop, TPixel source, float opacity) @@ -1658,7 +1576,6 @@ public static TPixel LightenDestOut(TPixel backdrop, TPixel source, floa return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel LightenClear(TPixel backdrop, TPixel source, float opacity) @@ -1670,7 +1587,6 @@ public static TPixel LightenClear(TPixel backdrop, TPixel source, float return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel LightenXor(TPixel backdrop, TPixel source, float opacity) @@ -1767,7 +1683,7 @@ public static Vector4 OverlayXor(Vector4 backdrop, Vector4 source, float opacity source.W *= opacity; return Xor(backdrop, source); - } + } [MethodImpl(MethodImplOptions.NoInlining)] public static Vector4 OverlayClear(Vector4 backdrop, Vector4 source, float opacity) @@ -1776,7 +1692,6 @@ public static Vector4 OverlayClear(Vector4 backdrop, Vector4 source, float opaci return Clear(backdrop, source); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel OverlaySrc(TPixel backdrop, TPixel source, float opacity) @@ -1788,7 +1703,6 @@ public static TPixel OverlaySrc(TPixel backdrop, TPixel source, float op return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel OverlaySrcAtop(TPixel backdrop, TPixel source, float opacity) @@ -1800,7 +1714,6 @@ public static TPixel OverlaySrcAtop(TPixel backdrop, TPixel source, floa return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel OverlaySrcOver(TPixel backdrop, TPixel source, float opacity) @@ -1812,7 +1725,6 @@ public static TPixel OverlaySrcOver(TPixel backdrop, TPixel source, floa return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel OverlaySrcIn(TPixel backdrop, TPixel source, float opacity) @@ -1824,7 +1736,6 @@ public static TPixel OverlaySrcIn(TPixel backdrop, TPixel source, float return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel OverlaySrcOut(TPixel backdrop, TPixel source, float opacity) @@ -1836,7 +1747,6 @@ public static TPixel OverlaySrcOut(TPixel backdrop, TPixel source, float return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel OverlayDest(TPixel backdrop, TPixel source, float opacity) @@ -1848,7 +1758,6 @@ public static TPixel OverlayDest(TPixel backdrop, TPixel source, float o return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel OverlayDestAtop(TPixel backdrop, TPixel source, float opacity) @@ -1860,7 +1769,6 @@ public static TPixel OverlayDestAtop(TPixel backdrop, TPixel source, flo return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel OverlayDestOver(TPixel backdrop, TPixel source, float opacity) @@ -1872,7 +1780,6 @@ public static TPixel OverlayDestOver(TPixel backdrop, TPixel source, flo return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel OverlayDestIn(TPixel backdrop, TPixel source, float opacity) @@ -1884,7 +1791,6 @@ public static TPixel OverlayDestIn(TPixel backdrop, TPixel source, float return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel OverlayDestOut(TPixel backdrop, TPixel source, float opacity) @@ -1896,7 +1802,6 @@ public static TPixel OverlayDestOut(TPixel backdrop, TPixel source, floa return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel OverlayClear(TPixel backdrop, TPixel source, float opacity) @@ -1908,7 +1813,6 @@ public static TPixel OverlayClear(TPixel backdrop, TPixel source, float return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel OverlayXor(TPixel backdrop, TPixel source, float opacity) @@ -2005,7 +1909,7 @@ public static Vector4 HardLightXor(Vector4 backdrop, Vector4 source, float opaci source.W *= opacity; return Xor(backdrop, source); - } + } [MethodImpl(MethodImplOptions.NoInlining)] public static Vector4 HardLightClear(Vector4 backdrop, Vector4 source, float opacity) @@ -2014,7 +1918,6 @@ public static Vector4 HardLightClear(Vector4 backdrop, Vector4 source, float opa return Clear(backdrop, source); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel HardLightSrc(TPixel backdrop, TPixel source, float opacity) @@ -2026,7 +1929,6 @@ public static TPixel HardLightSrc(TPixel backdrop, TPixel source, float return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel HardLightSrcAtop(TPixel backdrop, TPixel source, float opacity) @@ -2038,7 +1940,6 @@ public static TPixel HardLightSrcAtop(TPixel backdrop, TPixel source, fl return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel HardLightSrcOver(TPixel backdrop, TPixel source, float opacity) @@ -2050,7 +1951,6 @@ public static TPixel HardLightSrcOver(TPixel backdrop, TPixel source, fl return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel HardLightSrcIn(TPixel backdrop, TPixel source, float opacity) @@ -2062,7 +1962,6 @@ public static TPixel HardLightSrcIn(TPixel backdrop, TPixel source, floa return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel HardLightSrcOut(TPixel backdrop, TPixel source, float opacity) @@ -2074,7 +1973,6 @@ public static TPixel HardLightSrcOut(TPixel backdrop, TPixel source, flo return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel HardLightDest(TPixel backdrop, TPixel source, float opacity) @@ -2086,7 +1984,6 @@ public static TPixel HardLightDest(TPixel backdrop, TPixel source, float return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel HardLightDestAtop(TPixel backdrop, TPixel source, float opacity) @@ -2098,7 +1995,6 @@ public static TPixel HardLightDestAtop(TPixel backdrop, TPixel source, f return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel HardLightDestOver(TPixel backdrop, TPixel source, float opacity) @@ -2110,7 +2006,6 @@ public static TPixel HardLightDestOver(TPixel backdrop, TPixel source, f return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel HardLightDestIn(TPixel backdrop, TPixel source, float opacity) @@ -2122,7 +2017,6 @@ public static TPixel HardLightDestIn(TPixel backdrop, TPixel source, flo return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel HardLightDestOut(TPixel backdrop, TPixel source, float opacity) @@ -2134,7 +2028,6 @@ public static TPixel HardLightDestOut(TPixel backdrop, TPixel source, fl return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel HardLightClear(TPixel backdrop, TPixel source, float opacity) @@ -2146,7 +2039,6 @@ public static TPixel HardLightClear(TPixel backdrop, TPixel source, floa return dest; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel HardLightXor(TPixel backdrop, TPixel source, float opacity) @@ -2159,4 +2051,4 @@ public static TPixel HardLightXor(TPixel backdrop, TPixel source, float } } -} \ No newline at end of file +} diff --git a/src/ImageSharp/PixelFormats/PixelBlenders/PorterDuffFunctions.Generated.tt b/src/ImageSharp/PixelFormats/PixelBlenders/PorterDuffFunctions.Generated.tt index c8345cfb9f..f591ee873d 100644 --- a/src/ImageSharp/PixelFormats/PixelBlenders/PorterDuffFunctions.Generated.tt +++ b/src/ImageSharp/PixelFormats/PixelBlenders/PorterDuffFunctions.Generated.tt @@ -1,4 +1,4 @@ -<# +<# // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. #> @@ -113,7 +113,7 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders source.W *= opacity; return Xor(backdrop, source); - } + } [MethodImpl(MethodImplOptions.NoInlining)] public static Vector4 <#=blender#>Clear(Vector4 backdrop, Vector4 source, float opacity) @@ -125,7 +125,7 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders <# } #> -<# void GenerateGenericPixelBlender(string blender, string composer) { #> +<# void GenerateGenericPixelBlender(string blender, string composer) { #> [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TPixel <#=blender#><#=composer#>(TPixel backdrop, TPixel source, float opacity) @@ -141,7 +141,7 @@ namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders <# -string[] composers = new []{ +var composers = new []{ "Src", "SrcAtop", "SrcOver", @@ -156,7 +156,7 @@ string[] composers = new []{ "Xor", }; -string[] blenders = new []{ +var blenders = new []{ "Normal", "Multiply", "Add", @@ -166,12 +166,12 @@ string[] blenders = new []{ "Lighten", "Overlay", "HardLight" -}; +}; foreach(var blender in blenders) - { - GeneratePixelBlenders(blender); - + { + GeneratePixelBlenders(blender); + foreach(var composer in composers) { GenerateGenericPixelBlender(blender,composer); @@ -180,4 +180,4 @@ string[] blenders = new []{ #> } -} \ No newline at end of file +} diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/HalfVector2.cs b/src/ImageSharp/PixelFormats/PixelImplementations/HalfVector2.cs index e2ed931b75..8854f16501 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/HalfVector2.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/HalfVector2.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; @@ -60,7 +60,7 @@ public struct HalfVector2 : IPixel, IPackedVector [MethodImpl(InliningOptions.ShortMethod)] public void FromScaledVector4(Vector4 vector) { - Vector2 scaled = new Vector2(vector.X, vector.Y) * 2F; + var scaled = new Vector2(vector.X, vector.Y) * 2F; scaled -= Vector2.One; this.PackedValue = Pack(scaled.X, scaled.Y); } @@ -173,4 +173,4 @@ private static uint Pack(float x, float y) return num2 | num; } } -} \ No newline at end of file +} diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedByte2.cs b/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedByte2.cs index cd95e87ecf..a24e725692 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedByte2.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedByte2.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; @@ -66,7 +66,7 @@ public NormalizedByte2(float x, float y) [MethodImpl(InliningOptions.ShortMethod)] public void FromScaledVector4(Vector4 vector) { - Vector2 scaled = new Vector2(vector.X, vector.Y) * 2F; + var scaled = new Vector2(vector.X, vector.Y) * 2F; scaled -= Vector2.One; this.PackedValue = Pack(scaled); } @@ -179,4 +179,4 @@ private static ushort Pack(Vector2 vector) return (ushort)(byte2 | byte1); } } -} \ No newline at end of file +} diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedShort2.cs b/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedShort2.cs index 8d7c400b45..3ede947139 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedShort2.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/NormalizedShort2.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; @@ -66,7 +66,7 @@ public NormalizedShort2(float x, float y) [MethodImpl(InliningOptions.ShortMethod)] public void FromScaledVector4(Vector4 vector) { - Vector2 scaled = new Vector2(vector.X, vector.Y) * 2F; + var scaled = new Vector2(vector.X, vector.Y) * 2F; scaled -= Vector2.One; this.PackedValue = Pack(scaled); } @@ -186,4 +186,4 @@ private static uint Pack(Vector2 vector) return word2 | word1; } } -} \ No newline at end of file +} diff --git a/src/ImageSharp/PixelFormats/PixelImplementations/Short2.cs b/src/ImageSharp/PixelFormats/PixelImplementations/Short2.cs index 803a77b23f..14987e5829 100644 --- a/src/ImageSharp/PixelFormats/PixelImplementations/Short2.cs +++ b/src/ImageSharp/PixelFormats/PixelImplementations/Short2.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,7 +72,7 @@ public Short2(float x, float y) [MethodImpl(InliningOptions.ShortMethod)] public void FromScaledVector4(Vector4 vector) { - Vector2 scaled = new Vector2(vector.X, vector.Y) * 65534F; + var scaled = new Vector2(vector.X, vector.Y) * 65534F; scaled -= new Vector2(32767F); this.PackedValue = Pack(scaled); } @@ -179,4 +179,4 @@ private static uint Pack(Vector2 vector) return word2 | word1; } } -} \ No newline at end of file +} diff --git a/src/ImageSharp/Primitives/Rational.cs b/src/ImageSharp/Primitives/Rational.cs index b598f0e02f..f9299bc178 100644 --- a/src/ImageSharp/Primitives/Rational.cs +++ b/src/ImageSharp/Primitives/Rational.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; @@ -43,7 +43,7 @@ public Rational(uint numerator, uint denominator, bool simplify) { if (simplify) { - LongRational rational = new LongRational(numerator, denominator).Simplify(); + var rational = new LongRational(numerator, denominator).Simplify(); this.Numerator = (uint)rational.Numerator; this.Denominator = (uint)rational.Denominator; @@ -187,4 +187,4 @@ public string ToString(IFormatProvider provider) return rational.ToString(provider); } } -} \ No newline at end of file +} diff --git a/src/ImageSharp/Primitives/SignedRational.cs b/src/ImageSharp/Primitives/SignedRational.cs index 7e486e4f22..395a24b14e 100644 --- a/src/ImageSharp/Primitives/SignedRational.cs +++ b/src/ImageSharp/Primitives/SignedRational.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; @@ -43,7 +43,7 @@ public SignedRational(int numerator, int denominator, bool simplify) { if (simplify) { - LongRational rational = new LongRational(numerator, denominator).Simplify(); + var rational = new LongRational(numerator, denominator).Simplify(); this.Numerator = (int)rational.Numerator; this.Denominator = (int)rational.Denominator; @@ -187,4 +187,4 @@ public string ToString(IFormatProvider provider) return rational.ToString(provider); } } -} \ No newline at end of file +} diff --git a/src/ImageSharp/Processing/Extensions/ProcessingExtensions.cs b/src/ImageSharp/Processing/Extensions/ProcessingExtensions.cs index cb3f8fa579..48876251e2 100644 --- a/src/ImageSharp/Processing/Extensions/ProcessingExtensions.cs +++ b/src/ImageSharp/Processing/Extensions/ProcessingExtensions.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; @@ -25,7 +25,7 @@ public static void Mutate(this Image source, Action ope Guard.NotNull(operation, nameof(operation)); source.EnsureNotDisposed(); - ProcessingVisitor visitor = new ProcessingVisitor(operation, true); + var visitor = new ProcessingVisitor(operation, true); source.AcceptVisitor(visitor); } @@ -77,7 +77,7 @@ public static Image Clone(this Image source, Action ope Guard.NotNull(operation, nameof(operation)); source.EnsureNotDisposed(); - ProcessingVisitor visitor = new ProcessingVisitor(operation, false); + var visitor = new ProcessingVisitor(operation, false); source.AcceptVisitor(visitor); return visitor.ResultImage; } diff --git a/src/ImageSharp/Processing/Processors/Effects/OilPaintingProcessor{TPixel}.cs b/src/ImageSharp/Processing/Processors/Effects/OilPaintingProcessor{TPixel}.cs index 7efb71fa1c..d31858ba15 100644 --- a/src/ImageSharp/Processing/Processors/Effects/OilPaintingProcessor{TPixel}.cs +++ b/src/ImageSharp/Processing/Processors/Effects/OilPaintingProcessor{TPixel}.cs @@ -69,10 +69,10 @@ protected override void OnFrameApply( int maxIntensity = 0; int maxIndex = 0; - int[] intensityBin = new int[levels]; - float[] redBin = new float[levels]; - float[] blueBin = new float[levels]; - float[] greenBin = new float[levels]; + var intensityBin = new int[levels]; + var redBin = new float[levels]; + var blueBin = new float[levels]; + var greenBin = new float[levels]; for (int fy = 0; fy <= radius; fy++) { @@ -126,4 +126,4 @@ protected override void OnFrameApply( } } } -} \ No newline at end of file +} diff --git a/src/ImageSharp/Processing/Processors/Quantization/PaletteQuantizer.cs b/src/ImageSharp/Processing/Processors/Quantization/PaletteQuantizer.cs index ba434a4b21..17734bcdc0 100644 --- a/src/ImageSharp/Processing/Processors/Quantization/PaletteQuantizer.cs +++ b/src/ImageSharp/Processing/Processors/Quantization/PaletteQuantizer.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; @@ -59,7 +59,7 @@ public PaletteQuantizer(ReadOnlyMemory palette, IErrorDiffuser diffuser) public IFrameQuantizer CreateFrameQuantizer(Configuration configuration) where TPixel : struct, IPixel { - TPixel[] palette = new TPixel[this.Palette.Length]; + var palette = new TPixel[this.Palette.Length]; Color.ToPixel(configuration, this.Palette.Span, palette.AsSpan()); return new PaletteFrameQuantizer(this.Diffuser, palette); } @@ -71,11 +71,11 @@ public IFrameQuantizer CreateFrameQuantizer(Configuration config maxColors = maxColors.Clamp(QuantizerConstants.MinColors, QuantizerConstants.MaxColors); int max = Math.Min(maxColors, this.Palette.Length); - TPixel[] palette = new TPixel[max]; + var palette = new TPixel[max]; Color.ToPixel(configuration, this.Palette.Span.Slice(0, max), palette.AsSpan()); return new PaletteFrameQuantizer(this.Diffuser, palette); } private static IErrorDiffuser GetDiffuser(bool dither) => dither ? KnownDiffusers.FloydSteinberg : null; } -} \ No newline at end of file +} diff --git a/src/ImageSharp/Processing/Processors/Quantization/WuFrameQuantizer{TPixel}.cs b/src/ImageSharp/Processing/Processors/Quantization/WuFrameQuantizer{TPixel}.cs index 2b1a24aee5..87d696dc91 100644 --- a/src/ImageSharp/Processing/Processors/Quantization/WuFrameQuantizer{TPixel}.cs +++ b/src/ImageSharp/Processing/Processors/Quantization/WuFrameQuantizer{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; @@ -828,7 +828,7 @@ private void Mark(ref Box cube, byte label) private void BuildCube() { this.colorCube = new Box[this.colors]; - double[] vv = new double[this.colors]; + var vv = new double[this.colors]; ref Box cube = ref this.colorCube[0]; cube.RMin = cube.GMin = cube.BMin = cube.AMin = 0; @@ -985,4 +985,4 @@ public override int GetHashCode() } } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Benchmarks/Codecs/Jpeg/DoubleBufferedStreams.cs b/tests/ImageSharp.Benchmarks/Codecs/Jpeg/DoubleBufferedStreams.cs index b0834eb52d..6f2c492d0a 100644 --- a/tests/ImageSharp.Benchmarks/Codecs/Jpeg/DoubleBufferedStreams.cs +++ b/tests/ImageSharp.Benchmarks/Codecs/Jpeg/DoubleBufferedStreams.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; @@ -117,7 +117,7 @@ public int SimpleReadByte() private static byte[] CreateTestBytes() { - byte[] buffer = new byte[DoubleBufferedStreamReader.ChunkLength * 3]; + var buffer = new byte[DoubleBufferedStreamReader.ChunkLength * 3]; var random = new Random(); random.NextBytes(buffer); diff --git a/tests/ImageSharp.Benchmarks/Codecs/Jpeg/YCbCrColorConversion.cs b/tests/ImageSharp.Benchmarks/Codecs/Jpeg/YCbCrColorConversion.cs index 8417b32f27..313a7c97d3 100644 --- a/tests/ImageSharp.Benchmarks/Codecs/Jpeg/YCbCrColorConversion.cs +++ b/tests/ImageSharp.Benchmarks/Codecs/Jpeg/YCbCrColorConversion.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; @@ -67,10 +67,10 @@ private static Buffer2D[] CreateRandomValues( float maxVal = 255f) { var rnd = new Random(42); - Buffer2D[] buffers = new Buffer2D[componentCount]; + var buffers = new Buffer2D[componentCount]; for (int i = 0; i < componentCount; i++) { - float[] values = new float[inputBufferLength]; + var values = new float[inputBufferLength]; for (int j = 0; j < inputBufferLength; j++) { @@ -84,4 +84,4 @@ private static Buffer2D[] CreateRandomValues( return buffers; } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Benchmarks/Color/RgbToYCbCr.cs b/tests/ImageSharp.Benchmarks/Color/RgbToYCbCr.cs index 5e3ba5d7b8..0571513f56 100644 --- a/tests/ImageSharp.Benchmarks/Color/RgbToYCbCr.cs +++ b/tests/ImageSharp.Benchmarks/Color/RgbToYCbCr.cs @@ -132,13 +132,13 @@ public void Setup() public unsafe void RgbaToYcbCrScalarFloat() { // Copy the input to the stack: - OnStackInputCache.Byte input = OnStackInputCache.Byte.Create(this.inputSourceRGB); + var input = OnStackInputCache.Byte.Create(this.inputSourceRGB); // On-stack output: Result result = default; - float* yPtr = (float*)&result.Y; - float* cbPtr = (float*)&result.Cb; - float* crPtr = (float*)&result.Cr; + var yPtr = (float*)&result.Y; + var cbPtr = (float*)&result.Cb; + var crPtr = (float*)&result.Cr; // end of code-bloat block :) for (int i = 0; i < InputColorCount; i++) @@ -158,20 +158,20 @@ public unsafe void RgbaToYcbCrScalarFloat() public unsafe void RgbaToYcbCrSimdFloat() { // Copy the input to the stack: - OnStackInputCache.Byte input = OnStackInputCache.Byte.Create(this.inputSourceRGB); + var input = OnStackInputCache.Byte.Create(this.inputSourceRGB); // On-stack output: Result result = default; - float* yPtr = (float*)&result.Y; - float* cbPtr = (float*)&result.Cb; - float* crPtr = (float*)&result.Cr; + var yPtr = (float*)&result.Y; + var cbPtr = (float*)&result.Cb; + var crPtr = (float*)&result.Cr; // end of code-bloat block :) for (int i = 0; i < InputColorCount; i++) { int i3 = i * 3; - Vector3 vectorRgb = new Vector3( + var vectorRgb = new Vector3( input.Data[i3 + 0], input.Data[i3 + 1], input.Data[i3 + 2] @@ -194,9 +194,9 @@ public unsafe void RgbaToYcbCrScaledIntegerSimd() // On-stack output: Result result = default; - float* yPtr = (float*)&result.Y; - float* cbPtr = (float*)&result.Cb; - float* crPtr = (float*)&result.Cr; + var yPtr = (float*)&result.Y; + var cbPtr = (float*)&result.Cb; + var crPtr = (float*)&result.Cr; // end of code-bloat block :) var yCoeffs = new Vector(ScaledCoeffs.Y); @@ -210,7 +210,7 @@ public unsafe void RgbaToYcbCrScaledIntegerSimd() for (int i = 0; i < InputColorCount; i += 2) { - Vector rgb = new Vector(this.inputSourceRGBAsInteger, i * 3); + var rgb = new Vector(this.inputSourceRGBAsInteger, i * 3); Vector y = yCoeffs * rgb; Vector cb = cbCoeffs * rgb; @@ -264,7 +264,7 @@ public unsafe void RgbaToYcbCrScaledIntegerSimdWithDotProduct() for (int i = 0; i < InputColorCount; i += 2) { - Vector rgb = new Vector(this.inputSourceRGBAsInteger, i * 3); + var rgb = new Vector(this.inputSourceRGBAsInteger, i * 3); Vector y = yCoeffs * rgb; Vector cb = cbCoeffs * rgb; @@ -299,7 +299,7 @@ private static unsafe void VectorizedConvertImpl( public unsafe void RgbaToYcbCrScaledInteger() { // Copy the input to the stack: - OnStackInputCache.Byte input = OnStackInputCache.Byte.Create(this.inputSourceRGB); + var input = OnStackInputCache.Byte.Create(this.inputSourceRGB); // On-stack output: Result result = default; @@ -338,7 +338,7 @@ public unsafe void RgbaToYcbCrScaledInteger() public unsafe void RgbaToYcbCrScaledIntegerLut() { // Copy the input to the stack: - OnStackInputCache.Byte input = OnStackInputCache.Byte.Create(this.inputSourceRGB); + var input = OnStackInputCache.Byte.Create(this.inputSourceRGB); // On-stack output: Result result = default; diff --git a/tests/ImageSharp.Benchmarks/General/PixelConversion/PixelConversion_Rgba32_To_Bgra32.cs b/tests/ImageSharp.Benchmarks/General/PixelConversion/PixelConversion_Rgba32_To_Bgra32.cs index 3b288260c5..cd0aed3c47 100644 --- a/tests/ImageSharp.Benchmarks/General/PixelConversion/PixelConversion_Rgba32_To_Bgra32.cs +++ b/tests/ImageSharp.Benchmarks/General/PixelConversion/PixelConversion_Rgba32_To_Bgra32.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -253,8 +253,8 @@ struct C private static void BitopsSimdImpl(ref Octet.OfUInt32 s, ref Octet.OfUInt32 d) { Vector sVec = Unsafe.As>(ref s); - Vector aMask = new Vector(0xFF00FF00); - Vector bMask = new Vector(0x00FF00FF); + var aMask = new Vector(0xFF00FF00); + var bMask = new Vector(0x00FF00FF); Vector aa = sVec & aMask; Vector bb = sVec & bMask; @@ -388,4 +388,4 @@ public static uint ToBgra32(uint packedRgba) // Bitops_Tuple | 64 | 75.47 ns | 1.1824 ns | 1.1060 ns | 0.91 | 0.01 | // BitOps_GroupAsULong | 64 | 65.42 ns | 0.7157 ns | 0.6695 ns | 0.79 | 0.01 | } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Benchmarks/General/Vectorization/BitwiseOrUint32.cs b/tests/ImageSharp.Benchmarks/General/Vectorization/BitwiseOrUint32.cs index 3afb796a7c..60bf615c56 100644 --- a/tests/ImageSharp.Benchmarks/General/Vectorization/BitwiseOrUint32.cs +++ b/tests/ImageSharp.Benchmarks/General/Vectorization/BitwiseOrUint32.cs @@ -41,14 +41,14 @@ public void Standard() [Benchmark] public void Simd() { - Vector v = new Vector(this.testValue); + var v = new Vector(this.testValue); for (int i = 0; i < this.input.Length; i+=Vector.Count) { - Vector a = new Vector(this.input, i); + var a = new Vector(this.input, i); a = Vector.BitwiseOr(a, v); a.CopyTo(this.result, i); } } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Benchmarks/General/Vectorization/MulFloat.cs b/tests/ImageSharp.Benchmarks/General/Vectorization/MulFloat.cs index 418209cbc3..79207a9ff3 100644 --- a/tests/ImageSharp.Benchmarks/General/Vectorization/MulFloat.cs +++ b/tests/ImageSharp.Benchmarks/General/Vectorization/MulFloat.cs @@ -41,11 +41,11 @@ public void Standard() [Benchmark] public void SimdMultiplyByVector() { - Vector v = new Vector(this.testValue); + var v = new Vector(this.testValue); for (int i = 0; i < this.input.Length; i += Vector.Count) { - Vector a = new Vector(this.input, i); + var a = new Vector(this.input, i); a = a * v; a.CopyTo(this.result, i); } @@ -58,10 +58,10 @@ public void SimdMultiplyByScalar() for (int i = 0; i < this.input.Length; i += Vector.Count) { - Vector a = new Vector(this.input, i); + var a = new Vector(this.input, i); a = a * v; a.CopyTo(this.result, i); } } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Benchmarks/General/Vectorization/MulUInt32.cs b/tests/ImageSharp.Benchmarks/General/Vectorization/MulUInt32.cs index 7253dbd6a1..d837556f7d 100644 --- a/tests/ImageSharp.Benchmarks/General/Vectorization/MulUInt32.cs +++ b/tests/ImageSharp.Benchmarks/General/Vectorization/MulUInt32.cs @@ -45,10 +45,10 @@ public void Simd() for (int i = 0; i < this.input.Length; i += Vector.Count) { - Vector a = new Vector(this.input, i); + var a = new Vector(this.input, i); a = a * v; a.CopyTo(this.result, i); } } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Benchmarks/General/Vectorization/ReinterpretUInt32AsFloat.cs b/tests/ImageSharp.Benchmarks/General/Vectorization/ReinterpretUInt32AsFloat.cs index 67a8a9f39e..19a1bcea45 100644 --- a/tests/ImageSharp.Benchmarks/General/Vectorization/ReinterpretUInt32AsFloat.cs +++ b/tests/ImageSharp.Benchmarks/General/Vectorization/ReinterpretUInt32AsFloat.cs @@ -53,10 +53,10 @@ public void Simd() { for (int i = 0; i < this.input.Length; i += Vector.Count) { - Vector a = new Vector(this.input, i); + var a = new Vector(this.input, i); Vector b = Vector.AsVectorSingle(a); b.CopyTo(this.result, i); } } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Benchmarks/General/Vectorization/VectorFetching.cs b/tests/ImageSharp.Benchmarks/General/Vectorization/VectorFetching.cs index f2dab02ef5..4d83dd4910 100644 --- a/tests/ImageSharp.Benchmarks/General/Vectorization/VectorFetching.cs +++ b/tests/ImageSharp.Benchmarks/General/Vectorization/VectorFetching.cs @@ -44,11 +44,11 @@ public void Baseline() [Benchmark] public void FetchWithVectorConstructor() { - Vector v = new Vector(this.testValue); + var v = new Vector(this.testValue); for (int i = 0; i < this.data.Length; i += Vector.Count) { - Vector a = new Vector(this.data, i); + var a = new Vector(this.data, i); a = a * v; a.CopyTo(this.data, i); } @@ -57,7 +57,7 @@ public void FetchWithVectorConstructor() [Benchmark] public void FetchWithUnsafeCast() { - Vector v = new Vector(this.testValue); + var v = new Vector(this.testValue); ref Vector start = ref Unsafe.As>(ref this.data[0]); int n = this.InputSize / Vector.Count; @@ -76,7 +76,7 @@ public void FetchWithUnsafeCast() [Benchmark] public void FetchWithUnsafeCastNoTempVector() { - Vector v = new Vector(this.testValue); + var v = new Vector(this.testValue); ref Vector start = ref Unsafe.As>(ref this.data[0]); int n = this.InputSize / Vector.Count; @@ -106,4 +106,4 @@ public void FetchWithUnsafeCastFromReference() } } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/Color/ColorTests.CastFrom.cs b/tests/ImageSharp.Tests/Color/ColorTests.CastFrom.cs index 22c6d55ad8..3fc4c56591 100644 --- a/tests/ImageSharp.Tests/Color/ColorTests.CastFrom.cs +++ b/tests/ImageSharp.Tests/Color/ColorTests.CastFrom.cs @@ -14,8 +14,8 @@ public class CastFrom [Fact] public void Rgba64() { - Rgba64 source = new Rgba64(100, 2222, 3333, 4444); - + var source = new Rgba64(100, 2222, 3333, 4444); + // Act: Color color = source; @@ -23,12 +23,12 @@ public void Rgba64() Rgba64 data = color.ToPixel(); Assert.Equal(source, data); } - + [Fact] public void Rgba32() { - Rgba32 source = new Rgba32(1, 22, 33, 231); - + var source = new Rgba32(1, 22, 33, 231); + // Act: Color color = source; @@ -36,12 +36,12 @@ public void Rgba32() Rgba32 data = color.ToPixel(); Assert.Equal(source, data); } - + [Fact] public void Argb32() { - Argb32 source = new Argb32(1, 22, 33, 231); - + var source = new Argb32(1, 22, 33, 231); + // Act: Color color = source; @@ -49,12 +49,12 @@ public void Argb32() Argb32 data = color.ToPixel(); Assert.Equal(source, data); } - + [Fact] public void Bgra32() { - Bgra32 source = new Bgra32(1, 22, 33, 231); - + var source = new Bgra32(1, 22, 33, 231); + // Act: Color color = source; @@ -62,12 +62,12 @@ public void Bgra32() Bgra32 data = color.ToPixel(); Assert.Equal(source, data); } - + [Fact] public void Rgb24() { - Rgb24 source = new Rgb24(1, 22, 231); - + var source = new Rgb24(1, 22, 231); + // Act: Color color = source; @@ -75,12 +75,12 @@ public void Rgb24() Rgb24 data = color.ToPixel(); Assert.Equal(source, data); } - + [Fact] public void Bgr24() { - Bgr24 source = new Bgr24(1, 22, 231); - + var source = new Bgr24(1, 22, 231); + // Act: Color color = source; @@ -90,4 +90,4 @@ public void Bgr24() } } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/Color/ColorTests.CastTo.cs b/tests/ImageSharp.Tests/Color/ColorTests.CastTo.cs index d44472b28a..fbd1c73f16 100644 --- a/tests/ImageSharp.Tests/Color/ColorTests.CastTo.cs +++ b/tests/ImageSharp.Tests/Color/ColorTests.CastTo.cs @@ -14,75 +14,75 @@ public class CastTo [Fact] public void Rgba64() { - Rgba64 source = new Rgba64(100, 2222, 3333, 4444); - + var source = new Rgba64(100, 2222, 3333, 4444); + // Act: - Color color = new Color(source); + var color = new Color(source); // Assert: Rgba64 data = color; Assert.Equal(source, data); } - + [Fact] public void Rgba32() { - Rgba32 source = new Rgba32(1, 22, 33, 231); - + var source = new Rgba32(1, 22, 33, 231); + // Act: - Color color = new Color(source); + var color = new Color(source); // Assert: Rgba32 data = color; Assert.Equal(source, data); } - + [Fact] public void Argb32() { - Argb32 source = new Argb32(1, 22, 33, 231); - + var source = new Argb32(1, 22, 33, 231); + // Act: - Color color = new Color(source); + var color = new Color(source); // Assert: Argb32 data = color; Assert.Equal(source, data); } - + [Fact] public void Bgra32() { - Bgra32 source = new Bgra32(1, 22, 33, 231); - + var source = new Bgra32(1, 22, 33, 231); + // Act: - Color color = new Color(source); + var color = new Color(source); // Assert: Bgra32 data = color; Assert.Equal(source, data); } - + [Fact] public void Rgb24() { - Rgb24 source = new Rgb24(1, 22, 231); - + var source = new Rgb24(1, 22, 231); + // Act: - Color color = new Color(source); + var color = new Color(source); // Assert: Rgb24 data = color; Assert.Equal(source, data); } - + [Fact] public void Bgr24() { - Bgr24 source = new Bgr24(1, 22, 231); - + var source = new Bgr24(1, 22, 231); + // Act: - Color color = new Color(source); + var color = new Color(source); // Assert: Bgr24 data = color; @@ -90,4 +90,4 @@ public void Bgr24() } } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/Color/ColorTests.ConstructFrom.cs b/tests/ImageSharp.Tests/Color/ColorTests.ConstructFrom.cs index 9d21cd80c5..7f7c084e74 100644 --- a/tests/ImageSharp.Tests/Color/ColorTests.ConstructFrom.cs +++ b/tests/ImageSharp.Tests/Color/ColorTests.ConstructFrom.cs @@ -14,75 +14,75 @@ public class ConstructFrom [Fact] public void Rgba64() { - Rgba64 source = new Rgba64(100, 2222, 3333, 4444); - + var source = new Rgba64(100, 2222, 3333, 4444); + // Act: - Color color = new Color(source); + var color = new Color(source); // Assert: Rgba64 data = color.ToPixel(); Assert.Equal(source, data); } - + [Fact] public void Rgba32() { - Rgba32 source = new Rgba32(1, 22, 33, 231); - + var source = new Rgba32(1, 22, 33, 231); + // Act: - Color color = new Color(source); + var color = new Color(source); // Assert: Rgba32 data = color.ToPixel(); Assert.Equal(source, data); } - + [Fact] public void Argb32() { - Argb32 source = new Argb32(1, 22, 33, 231); - + var source = new Argb32(1, 22, 33, 231); + // Act: - Color color = new Color(source); + var color = new Color(source); // Assert: Argb32 data = color.ToPixel(); Assert.Equal(source, data); } - + [Fact] public void Bgra32() { - Bgra32 source = new Bgra32(1, 22, 33, 231); - + var source = new Bgra32(1, 22, 33, 231); + // Act: - Color color = new Color(source); + var color = new Color(source); // Assert: Bgra32 data = color.ToPixel(); Assert.Equal(source, data); } - + [Fact] public void Rgb24() { - Rgb24 source = new Rgb24(1, 22, 231); - + var source = new Rgb24(1, 22, 231); + // Act: - Color color = new Color(source); + var color = new Color(source); // Assert: Rgb24 data = color.ToPixel(); Assert.Equal(source, data); } - + [Fact] public void Bgr24() { - Bgr24 source = new Bgr24(1, 22, 231); - + var source = new Bgr24(1, 22, 231); + // Act: - Color color = new Color(source); + var color = new Color(source); // Assert: Bgr24 data = color.ToPixel(); @@ -90,4 +90,4 @@ public void Bgr24() } } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/Color/ColorTests.cs b/tests/ImageSharp.Tests/Color/ColorTests.cs index da35e7f5fc..6d9b34ee95 100644 --- a/tests/ImageSharp.Tests/Color/ColorTests.cs +++ b/tests/ImageSharp.Tests/Color/ColorTests.cs @@ -18,47 +18,47 @@ public void WithAlpha() Color c1 = Color.FromRgba(111, 222, 55, 255); Color c2 = c1.WithAlpha(0.5f); - Rgba32 expected = new Rgba32(111, 222, 55, 128); - + var expected = new Rgba32(111, 222, 55, 128); + Assert.Equal(expected, (Rgba32)c2); } - + [Fact] public void Equality_WhenTrue() { Color c1 = new Rgba64(100, 2000, 3000, 40000); Color c2 = new Rgba64(100, 2000, 3000, 40000); - + Assert.True(c1.Equals(c2)); Assert.True(c1 == c2); Assert.False(c1 != c2); Assert.True(c1.GetHashCode() == c2.GetHashCode()); } - + [Fact] public void Equality_WhenFalse() { Color c1 = new Rgba64(100, 2000, 3000, 40000); Color c2 = new Rgba64(101, 2000, 3000, 40000); Color c3 = new Rgba64(100, 2000, 3000, 40001); - + Assert.False(c1.Equals(c2)); Assert.False(c2.Equals(c3)); Assert.False(c3.Equals(c1)); - + Assert.False(c1 == c2); Assert.True(c1 != c2); - + Assert.False(c1.Equals(null)); } - + [Fact] public void ToHex() { string expected = "ABCD1234"; Color color = Color.FromHex(expected); string actual = color.ToHex(); - + Assert.Equal(expected, actual); } @@ -75,7 +75,7 @@ public void WernerPalette_IsCorrect() Rgba32[] actualPalette = Color.WernerPalette.ToArray().Select(c => (Rgba32)c).ToArray(); Assert.Equal(ReferencePalette.WernerColors, actualPalette); } - + public class FromHex { [Fact] @@ -106,4 +106,4 @@ public void ThrowsOnNull() } } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/Colorspaces/RgbTests.cs b/tests/ImageSharp.Tests/Colorspaces/RgbTests.cs index 7987fbe9f2..17816aab18 100644 --- a/tests/ImageSharp.Tests/Colorspaces/RgbTests.cs +++ b/tests/ImageSharp.Tests/Colorspaces/RgbTests.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; diff --git a/tests/ImageSharp.Tests/Common/SimdUtilsTests.cs b/tests/ImageSharp.Tests/Common/SimdUtilsTests.cs index 4f8a2cdaf7..58317ca49f 100644 --- a/tests/ImageSharp.Tests/Common/SimdUtilsTests.cs +++ b/tests/ImageSharp.Tests/Common/SimdUtilsTests.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; @@ -44,7 +44,7 @@ public void PseudoRound(float x, float y, float z, float w) private static Vector CreateExactTestVector1() { - float[] data = new float[Vector.Count]; + var data = new float[Vector.Count]; data[0] = 0.1f; data[1] = 0.4f; @@ -60,7 +60,7 @@ private static Vector CreateExactTestVector1() private static Vector CreateRandomTestVector(int seed, float min, float max) { - float[] data = new float[Vector.Count]; + var data = new float[Vector.Count]; var rnd = new Random(seed); @@ -128,7 +128,7 @@ public void BasicIntrinsics256_BulkConvertNormalizedFloatToByte_WithRoundedData( float[] orig = new Random(seed).GenerateRandomRoundedFloatArray(count, 0, 256); float[] normalized = orig.Select(f => f / 255f).ToArray(); - byte[] dest = new byte[count]; + var dest = new byte[count]; SimdUtils.BasicIntrinsics256.BulkConvertNormalizedFloatToByte(normalized, dest); @@ -151,7 +151,7 @@ public void BasicIntrinsics256_BulkConvertNormalizedFloatToByte_WithNonRoundedDa float[] source = new Random(seed).GenerateRandomFloatArray(count, 0, 1f); - byte[] dest = new byte[count]; + var dest = new byte[count]; SimdUtils.BasicIntrinsics256.BulkConvertNormalizedFloatToByte(source, dest); @@ -193,7 +193,7 @@ public void BasicIntrinsics256_BulkConvertByteToNormalizedFloat(int count) count, (s, d) => SimdUtils.BasicIntrinsics256.BulkConvertByteToNormalizedFloat(s.Span, d.Span)); } - + [Theory] [MemberData(nameof(ArraySizesDivisibleBy32))] public void ExtendedIntrinsics_BulkConvertByteToNormalizedFloat(int count) @@ -217,7 +217,7 @@ private static void TestImpl_BulkConvertByteToNormalizedFloat( Action, Memory> convert) { byte[] source = new Random(count).GenerateRandomByteArray(count); - float[] result = new float[count]; + var result = new float[count]; float[] expected = source.Select(b => (float)b / 255f).ToArray(); convert(source, result); @@ -306,7 +306,7 @@ private static void TestImpl_BulkConvertNormalizedFloatToByteClampOverflows( seed = seed > 0 ? seed : count; float[] source = new Random(seed).GenerateRandomFloatArray(count, -0.2f, 1.2f); byte[] expected = source.Select(NormalizedFloatToByte).ToArray(); - byte[] actual = new byte[count]; + var actual = new byte[count]; convert(source, actual); @@ -325,7 +325,7 @@ private static void TestImpl_BulkConvertNormalizedFloatToByteClampOverflows( private void MagicConvertToByte(float value) { byte actual = MagicConvert(value / 256f); - byte expected = (byte)value; + var expected = (byte)value; Assert.Equal(expected, actual); } @@ -362,7 +362,7 @@ private void MagicConvert(Span source, Span dest) { var magick = new Vector(32768.0f); - Vector scale = new Vector(255f) / new Vector(256f); + var scale = new Vector(255f) / new Vector(256f); Vector x = MemoryMarshal.Cast>(source)[0]; @@ -392,4 +392,4 @@ private static void AssertEvenRoundIsCorrect(Vector r, Vector v) } } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/Drawing/DrawImageTests.cs b/tests/ImageSharp.Tests/Drawing/DrawImageTests.cs index e6a3b99130..86c1c28504 100644 --- a/tests/ImageSharp.Tests/Drawing/DrawImageTests.cs +++ b/tests/ImageSharp.Tests/Drawing/DrawImageTests.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; @@ -75,13 +75,13 @@ public void WorksWithDifferentConfigurations( using (Image image = provider.GetImage()) using (var blend = Image.Load(TestFile.Create(brushImage).Bytes)) { - Size size = new Size(image.Width * 3 / 4, image.Height * 3 / 4); - Point position = new Point(image.Width / 8, image.Height / 8); + var size = new Size(image.Width * 3 / 4, image.Height * 3 / 4); + var position = new Point(image.Width / 8, image.Height / 8); blend.Mutate(x => x.Resize(size.Width, size.Height, KnownResamplers.Bicubic)); image.Mutate(x => x.DrawImage(blend, position, mode, opacity)); FormattableString testInfo = $"{System.IO.Path.GetFileNameWithoutExtension(brushImage)}-{mode}-{opacity}"; - PngEncoder encoder = new PngEncoder(); + var encoder = new PngEncoder(); if (provider.PixelType == PixelTypes.Rgba64) { @@ -197,4 +197,4 @@ void Test() } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/Drawing/DrawPathTests.cs b/tests/ImageSharp.Tests/Drawing/DrawPathTests.cs index 4a320d66b2..8c2c6fc6ed 100644 --- a/tests/ImageSharp.Tests/Drawing/DrawPathTests.cs +++ b/tests/ImageSharp.Tests/Drawing/DrawPathTests.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; @@ -59,7 +59,7 @@ public void DrawPath(TestImageProvider provider, string colorNam public void PathExtendingOffEdgeOfImageShouldNotBeCropped(TestImageProvider provider) where TPixel : struct, IPixel { - Color color = Color.White; + var color = Color.White; Pen pen = Pens.Solid(color, 5f); provider.RunValidatingProcessorTest( @@ -67,7 +67,7 @@ public void PathExtendingOffEdgeOfImageShouldNotBeCropped(TestImageProvi { for (int i = 0; i < 300; i += 20) { - PointF[] points = new PointF[] { new Vector2(100, 2), new Vector2(-10, i) }; + var points = new PointF[] { new Vector2(100, 2), new Vector2(-10, i) }; x.DrawLines(pen, points); } }, @@ -75,4 +75,4 @@ public void PathExtendingOffEdgeOfImageShouldNotBeCropped(TestImageProvi appendSourceFileOrDescription: false); } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/Drawing/FillPolygonTests.cs b/tests/ImageSharp.Tests/Drawing/FillPolygonTests.cs index af92876cdd..104237ec3e 100644 --- a/tests/ImageSharp.Tests/Drawing/FillPolygonTests.cs +++ b/tests/ImageSharp.Tests/Drawing/FillPolygonTests.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; @@ -28,18 +28,18 @@ public void FillPolygon_Solid(TestImageProvider provider, string new Vector2(10, 10), new Vector2(200, 150), new Vector2(50, 300) }; Color color = TestUtils.GetColorByName(colorName).WithAlpha(alpha); - - GraphicsOptions options = new GraphicsOptions(antialias); + + var options = new GraphicsOptions(antialias); string aa = antialias ? "" : "_NoAntialias"; FormattableString outputDetails = $"{colorName}_A{alpha}{aa}"; - + provider.RunValidatingProcessorTest( c => c.FillPolygon(options, color, simplePath), outputDetails, appendSourceFileOrDescription: false); } - + [Theory] [WithBasicTestPatternImages(200, 200, PixelTypes.Rgba32)] public void FillPolygon_Concave(TestImageProvider provider) @@ -47,15 +47,15 @@ public void FillPolygon_Concave(TestImageProvider provider) { var points = new SixLabors.Primitives.PointF[] { - new Vector2(8, 8), - new Vector2(64, 8), - new Vector2(64, 64), + new Vector2(8, 8), + new Vector2(64, 8), + new Vector2(64, 64), new Vector2(120, 64), - new Vector2(120, 120), + new Vector2(120, 120), new Vector2(8, 120) }; - - Color color = Color.LightGreen; + + var color = Color.LightGreen; provider.RunValidatingProcessorTest( c => c.FillPolygon(color, points), @@ -72,15 +72,15 @@ public void FillPolygon_Pattern(TestImageProvider provider) { new Vector2(10, 10), new Vector2(200, 150), new Vector2(50, 300) }; - Color color = Color.Yellow; + var color = Color.Yellow; var brush = Brushes.Horizontal(color); - + provider.RunValidatingProcessorTest( c => c.FillPolygon(brush, simplePath), appendSourceFileOrDescription: false); } - + [Theory] [WithBasicTestPatternImages(250, 350, PixelTypes.Rgba32, TestImages.Png.Ducky)] [WithBasicTestPatternImages(250, 350, PixelTypes.Rgba32, TestImages.Bmp.Car)] @@ -95,7 +95,7 @@ public void FillPolygon_ImageBrush(TestImageProvider provider, s using (Image brushImage = Image.Load(TestFile.Create(brushImageName).Bytes)) { var brush = new ImageBrush(brushImage); - + provider.RunValidatingProcessorTest( c => c.FillPolygon(brush, simplePath), System.IO.Path.GetFileNameWithoutExtension(brushImageName), @@ -109,13 +109,13 @@ public void Fill_RectangularPolygon(TestImageProvider provider) where TPixel : struct, IPixel { var polygon = new SixLabors.Shapes.RectangularPolygon(10, 10, 190, 140); - Color color = Color.White; + var color = Color.White; provider.RunValidatingProcessorTest( c => c.Fill(color, polygon), - appendSourceFileOrDescription: false); + appendSourceFileOrDescription: false); } - + [Theory] [WithBasicTestPatternImages(200, 200, PixelTypes.Rgba32, 3, 50, 0f)] [WithBasicTestPatternImages(200, 200, PixelTypes.Rgba32, 3, 60, 20f)] @@ -127,7 +127,7 @@ public void Fill_RegularPolygon(TestImageProvider provider, int { float angle = GeometryUtilities.DegreeToRadian(angleDeg); var polygon = new RegularPolygon(100, 100, vertices, radius, angle); - Color color = Color.Yellow; + var color = Color.Yellow; FormattableString testOutput = $"V({vertices})_R({radius})_Ang({angleDeg})"; provider.RunValidatingProcessorTest( @@ -143,7 +143,7 @@ public void Fill_EllipsePolygon(TestImageProvider provider) where TPixel : struct, IPixel { var polygon = new EllipsePolygon(100, 100, 80, 120); - Color color = Color.Azure; + var color = Color.Azure; provider.RunValidatingProcessorTest( c => c.Fill(color, polygon), diff --git a/tests/ImageSharp.Tests/Drawing/FillSolidBrushTests.cs b/tests/ImageSharp.Tests/Drawing/FillSolidBrushTests.cs index 83f2537e75..a5e7450839 100644 --- a/tests/ImageSharp.Tests/Drawing/FillSolidBrushTests.cs +++ b/tests/ImageSharp.Tests/Drawing/FillSolidBrushTests.cs @@ -30,7 +30,7 @@ public void DoesNotDependOnSize(TestImageProvider provider) { using (Image image = provider.GetImage()) { - Color color = Color.HotPink; + var color = Color.HotPink; image.Mutate(c => c.Fill(color)); image.DebugSave(provider, appendPixelTypeToFileName: false); @@ -45,7 +45,7 @@ public void DoesNotDependOnSinglePixelType(TestImageProvider pro { using (Image image = provider.GetImage()) { - Color color = Color.HotPink; + var color = Color.HotPink; image.Mutate(c => c.Fill(color)); image.DebugSave(provider, appendSourceFileOrDescription: false); diff --git a/tests/ImageSharp.Tests/Drawing/Text/DrawTextOnImageTests.cs b/tests/ImageSharp.Tests/Drawing/Text/DrawTextOnImageTests.cs index 73a1114d37..7bebdabd3a 100644 --- a/tests/ImageSharp.Tests/Drawing/Text/DrawTextOnImageTests.cs +++ b/tests/ImageSharp.Tests/Drawing/Text/DrawTextOnImageTests.cs @@ -40,7 +40,7 @@ public void DoesntThrowExceptionWhenOverlappingRightEdge_Issue688(TestIm where TPixel : struct, IPixel { Font font = CreateFont("OpenSans-Regular.ttf", 36); - Color color = Color.Black; + var color = Color.Black; var text = "A short piece of text"; using (var img = provider.GetImage()) @@ -52,7 +52,7 @@ public void DoesntThrowExceptionWhenOverlappingRightEdge_Issue688(TestIm float scalingFactor = Math.Min(img.Width / size.Width, img.Height / size.Height); //create a new font - Font scaledFont = new Font(font, scalingFactor * font.Size); + var scaledFont = new Font(font, scalingFactor * font.Size); var center = new PointF(img.Width / 2, img.Height / 2); var textGraphicOptions = new TextGraphicsOptions(true) @@ -80,7 +80,7 @@ public void FontShapesAreRenderedCorrectly( where TPixel : struct, IPixel { Font font = CreateFont(fontName, fontSize); - Color color = Color.Black; + var color = Color.Black; provider.VerifyOperation( TextDrawingComparer, @@ -125,7 +125,7 @@ public void FontShapesAreRenderedCorrectly_LargeText( HorizontalAlignment = HorizontalAlignment.Left, }; - Color color = Color.Black; + var color = Color.Black; // Based on the reported 0.0270% difference with AccuracyMultiple = 8 // We should avoid quality regressions leading to higher difference! @@ -155,7 +155,7 @@ public void FontShapesAreRenderedCorrectlyWithAPen( where TPixel : struct, IPixel { Font font = CreateFont(fontName, fontSize); - Color color = Color.Black; + var color = Color.Black; provider.VerifyOperation( OutlinedTextDrawingComparer, @@ -182,7 +182,7 @@ public void FontShapesAreRenderedCorrectlyWithAPenPatterned( where TPixel : struct, IPixel { Font font = CreateFont(fontName, fontSize); - Color color = Color.Black; + var color = Color.Black; provider.VerifyOperation( OutlinedTextDrawingComparer, diff --git a/tests/ImageSharp.Tests/Formats/Bmp/BmpFileHeaderTests.cs b/tests/ImageSharp.Tests/Formats/Bmp/BmpFileHeaderTests.cs index 8ad227cfdc..25cf29406e 100644 --- a/tests/ImageSharp.Tests/Formats/Bmp/BmpFileHeaderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Bmp/BmpFileHeaderTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using SixLabors.ImageSharp.Formats.Bmp; using Xunit; @@ -11,11 +11,11 @@ public void TestWrite() { var header = new BmpFileHeader(1, 2, 3, 4); - byte[] buffer = new byte[14]; + var buffer = new byte[14]; header.WriteTo(buffer); Assert.Equal("AQACAAAAAwAAAAQAAAA=", Convert.ToBase64String(buffer)); } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/Formats/Jpg/Block8x8FTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/Block8x8FTests.cs index 93f3f70894..21b9b6cab6 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/Block8x8FTests.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/Block8x8FTests.cs @@ -72,7 +72,7 @@ public void Indexer_ReferenceBenchmarkWithArray() () => { // Block8x8F block = new Block8x8F(); - float[] block = new float[64]; + var block = new float[64]; for (int i = 0; i < Block8x8F.Size; i++) { block[i] = i; @@ -90,8 +90,8 @@ public void Indexer_ReferenceBenchmarkWithArray() [Fact] public void Load_Store_FloatArray() { - float[] data = new float[Block8x8F.Size]; - float[] mirror = new float[Block8x8F.Size]; + var data = new float[Block8x8F.Size]; + var mirror = new float[Block8x8F.Size]; for (int i = 0; i < Block8x8F.Size; i++) { @@ -115,8 +115,8 @@ public void Load_Store_FloatArray() [Fact] public unsafe void Load_Store_FloatArray_Ptr() { - float[] data = new float[Block8x8F.Size]; - float[] mirror = new float[Block8x8F.Size]; + var data = new float[Block8x8F.Size]; + var mirror = new float[Block8x8F.Size]; for (int i = 0; i < Block8x8F.Size; i++) { @@ -140,8 +140,8 @@ public unsafe void Load_Store_FloatArray_Ptr() [Fact] public void Load_Store_IntArray() { - int[] data = new int[Block8x8F.Size]; - int[] mirror = new int[Block8x8F.Size]; + var data = new int[Block8x8F.Size]; + var mirror = new int[Block8x8F.Size]; for (int i = 0; i < Block8x8F.Size; i++) { @@ -174,7 +174,7 @@ public void TransposeInto() var dest = new Block8x8F(); source.TransposeInto(ref dest); - float[] actual = new float[64]; + var actual = new float[64]; dest.CopyTo(actual); Assert.Equal(expected, actual); @@ -206,7 +206,7 @@ public void TransposeInto_Benchmark() private static float[] Create8x8ColorCropTestData() { - float[] result = new float[64]; + var result = new float[64]; for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) @@ -230,7 +230,7 @@ public void NormalizeColors() Block8x8F dest = block; dest.NormalizeColorsInplace(255); - float[] array = new float[64]; + var array = new float[64]; dest.CopyTo(array); this.Output.WriteLine("Result:"); this.PrintLinearData(array); diff --git a/tests/ImageSharp.Tests/Formats/Jpg/DCTTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/DCTTests.cs index 04e55fad3b..91e2f43d35 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/DCTTests.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/DCTTests.cs @@ -22,7 +22,7 @@ public FastFloatingPoint(ITestOutputHelper output) public void iDCT2D8x4_LeftPart() { float[] sourceArray = Create8x8FloatData(); - float[] expectedDestArray = new float[64]; + var expectedDestArray = new float[64]; ReferenceImplementations.LLM_FloatingPoint_DCT.iDCT2D8x4_32f(sourceArray, expectedDestArray); @@ -33,7 +33,7 @@ public void iDCT2D8x4_LeftPart() FastFloatingPointDCT.IDCT8x4_LeftPart(ref source, ref dest); - float[] actualDestArray = new float[64]; + var actualDestArray = new float[64]; dest.CopyTo(actualDestArray); this.Print8x8Data(expectedDestArray); @@ -47,7 +47,7 @@ public void iDCT2D8x4_LeftPart() public void iDCT2D8x4_RightPart() { float[] sourceArray = Create8x8FloatData(); - float[] expectedDestArray = new float[64]; + var expectedDestArray = new float[64]; ReferenceImplementations.LLM_FloatingPoint_DCT.iDCT2D8x4_32f(sourceArray.AsSpan(4), expectedDestArray.AsSpan(4)); @@ -58,7 +58,7 @@ public void iDCT2D8x4_RightPart() FastFloatingPointDCT.IDCT8x4_RightPart(ref source, ref dest); - float[] actualDestArray = new float[64]; + var actualDestArray = new float[64]; dest.CopyTo(actualDestArray); this.Print8x8Data(expectedDestArray); @@ -118,12 +118,12 @@ public void FDCT8x4_LeftPart(int seed) var destBlock = new Block8x8F(); - float[] expectedDest = new float[64]; + var expectedDest = new float[64]; ReferenceImplementations.LLM_FloatingPoint_DCT.fDCT2D8x4_32f(src, expectedDest); FastFloatingPointDCT.FDCT8x4_LeftPart(ref srcBlock, ref destBlock); - float[] actualDest = new float[64]; + var actualDest = new float[64]; destBlock.CopyTo(actualDest); Assert.Equal(actualDest, expectedDest, new ApproximateFloatComparer(1f)); @@ -140,12 +140,12 @@ public void FDCT8x4_RightPart(int seed) var destBlock = new Block8x8F(); - float[] expectedDest = new float[64]; + var expectedDest = new float[64]; ReferenceImplementations.LLM_FloatingPoint_DCT.fDCT2D8x4_32f(src.Slice(4), expectedDest.AsSpan(4)); FastFloatingPointDCT.FDCT8x4_RightPart(ref srcBlock, ref destBlock); - float[] actualDest = new float[64]; + var actualDest = new float[64]; destBlock.CopyTo(actualDest); Assert.Equal(actualDest, expectedDest, new ApproximateFloatComparer(1f)); @@ -162,14 +162,14 @@ public void TransformFDCT(int seed) var destBlock = new Block8x8F(); - float[] expectedDest = new float[64]; - float[] temp1 = new float[64]; + var expectedDest = new float[64]; + var temp1 = new float[64]; var temp2 = new Block8x8F(); ReferenceImplementations.LLM_FloatingPoint_DCT.fDCT2D_llm(src, expectedDest, temp1, downscaleBy8: true); FastFloatingPointDCT.TransformFDCT(ref srcBlock, ref destBlock, ref temp2, false); - float[] actualDest = new float[64]; + var actualDest = new float[64]; destBlock.CopyTo(actualDest); Assert.Equal(actualDest, expectedDest, new ApproximateFloatComparer(1f)); diff --git a/tests/ImageSharp.Tests/Formats/Jpg/Utils/JpegFixture.cs b/tests/ImageSharp.Tests/Formats/Jpg/Utils/JpegFixture.cs index 89fdd5745e..20830a33f5 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/Utils/JpegFixture.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/Utils/JpegFixture.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 @@ -25,7 +25,7 @@ public JpegFixture(ITestOutputHelper output) : base(output) // ReSharper disable once InconsistentNaming public static float[] Create8x8FloatData() { - float[] result = new float[64]; + var result = new float[64]; for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) @@ -39,7 +39,7 @@ public static float[] Create8x8FloatData() // ReSharper disable once InconsistentNaming public static int[] Create8x8IntData() { - int[] result = new int[64]; + var result = new int[64]; for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) @@ -53,7 +53,7 @@ public static int[] Create8x8IntData() // ReSharper disable once InconsistentNaming public static short[] Create8x8ShortData() { - short[] result = new short[64]; + var result = new short[64]; for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) @@ -73,7 +73,7 @@ public static short[] Create8x8ShortData() public static int[] Create8x8RandomIntData(int minValue, int maxValue, int seed = 42) { var rnd = new Random(seed); - int[] result = new int[64]; + var result = new int[64]; for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) @@ -90,7 +90,7 @@ internal static float[] Create8x8RoundedRandomFloatData(int minValue, int maxVal public static float[] Create8x8RandomFloatData(float minValue, float maxValue, int seed = 42) { var rnd = new Random(seed); - float[] result = new float[64]; + var result = new float[64]; for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) @@ -189,4 +189,4 @@ internal static JpegDecoderCore ParseJpegStream(string testFileName, bool metaDa } } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/Formats/Jpg/Utils/LibJpegTools.cs b/tests/ImageSharp.Tests/Formats/Jpg/Utils/LibJpegTools.cs index 5a62de0347..31779df453 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/Utils/LibJpegTools.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/Utils/LibJpegTools.cs @@ -109,7 +109,7 @@ public static SpectralData ExtractSpectralData(string inputFile) result[i] = resultComponent; } - byte[] buffer = new byte[64 * sizeof(short)]; + var buffer = new byte[64 * sizeof(short)]; for (int i = 0; i < result.Length; i++) { diff --git a/tests/ImageSharp.Tests/Formats/Jpg/Utils/ReferenceImplementations.AccurateDCT.cs b/tests/ImageSharp.Tests/Formats/Jpg/Utils/ReferenceImplementations.AccurateDCT.cs index 46f0305807..58fa4231e6 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/Utils/ReferenceImplementations.AccurateDCT.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/Utils/ReferenceImplementations.AccurateDCT.cs @@ -101,7 +101,7 @@ public static Block8x8F TransformFDCT(ref Block8x8F block) private static double[,] InitCosLut() { - double[,] coslu = new double[8, 8]; + var coslu = new double[8, 8]; int a, b; double tmp; 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 df5ec97408..0c644e5c21 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 @@ -29,10 +29,10 @@ internal static class LLM_FloatingPoint_DCT { public static Block8x8F TransformIDCT(ref Block8x8F source) { - float[] s = new float[64]; + var s = new float[64]; source.CopyTo(s); - float[] d = new float[64]; - float[] temp = new float[64]; + var d = new float[64]; + var temp = new float[64]; iDCT2D_llm(s, d, temp); Block8x8F result = default; @@ -42,10 +42,10 @@ public static Block8x8F TransformIDCT(ref Block8x8F source) public static Block8x8F TransformFDCT_UpscaleBy8(ref Block8x8F source) { - float[] s = new float[64]; + var s = new float[64]; source.CopyTo(s); - float[] d = new float[64]; - float[] temp = new float[64]; + var d = new float[64]; + var temp = new float[64]; fDCT2D_llm(s, d, temp); Block8x8F result = default; @@ -61,7 +61,7 @@ public static Block8x8F TransformFDCT_UpscaleBy8(ref Block8x8F source) public static float[] PrintConstants(ITestOutputHelper output) { - float[] r = new float[8]; + var r = new float[8]; for (int i = 0; i < 8; i++) { r[i] = (float)(Cos(i / 16.0 * M_PI) * M_SQRT2); @@ -466,7 +466,7 @@ internal static void fDCT1Dllm_32f(Span x, Span y) { float t0, t1, t2, t3, t4, t5, t6, t7; float c0, c1, c2, c3; - float[] r = new float[8]; + var r = new float[8]; //for(i = 0;i < 8;i++){ r[i] = (float)(cos((double)i / 16.0 * M_PI) * M_SQRT2); } r[0] = 1.414214f; diff --git a/tests/ImageSharp.Tests/Formats/Jpg/Utils/ReferenceImplementations.StandardIntegerDCT.cs b/tests/ImageSharp.Tests/Formats/Jpg/Utils/ReferenceImplementations.StandardIntegerDCT.cs index cc701c8140..a929e0eb02 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/Utils/ReferenceImplementations.StandardIntegerDCT.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/Utils/ReferenceImplementations.StandardIntegerDCT.cs @@ -70,7 +70,7 @@ public static class StandardIntegerDCT public static Block8x8 Subtract128_TransformFDCT_Upscale8(ref Block8x8 block) { - int[] temp = new int[Block8x8.Size]; + var temp = new int[Block8x8.Size]; block.CopyTo(temp); Subtract128_TransformFDCT_Upscale8_Inplace(temp); var result = default(Block8x8); @@ -81,7 +81,7 @@ public static Block8x8 Subtract128_TransformFDCT_Upscale8(ref Block8x8 block) // [Obsolete("Looks like this method produces really bad results for bigger values!")] public static Block8x8 TransformIDCT(ref Block8x8 block) { - int[] temp = new int[Block8x8.Size]; + var temp = new int[Block8x8.Size]; block.CopyTo(temp); TransformIDCTInplace(temp); var result = default(Block8x8); @@ -364,4 +364,4 @@ public static void TransformIDCTInplace(Span src) } } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/Formats/Jpg/Utils/SpanExtensions.cs b/tests/ImageSharp.Tests/Formats/Jpg/Utils/SpanExtensions.cs index f604cb1b5e..142e38dc0a 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/Utils/SpanExtensions.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/Utils/SpanExtensions.cs @@ -75,7 +75,7 @@ public static void LoadFrom(this Span data, ref Vector4 v) /// A new with float values public static float[] ConvertAllToFloat(this int[] src) { - float[] result = new float[src.Length]; + var result = new float[src.Length]; for (int i = 0; i < src.Length; i++) { result[i] = src[i]; @@ -92,7 +92,7 @@ public static float[] ConvertAllToFloat(this int[] src) /// A new instance of public static Span AddScalarToAllValues(this Span src, float scalar) { - float[] result = new float[src.Length]; + var result = new float[src.Length]; for (int i = 0; i < src.Length; i++) { result[i] = src[i] + scalar; @@ -109,7 +109,7 @@ public static Span AddScalarToAllValues(this Span src, float scala /// A new instance of public static Span AddScalarToAllValues(this Span src, int scalar) { - int[] result = new int[src.Length]; + var result = new int[src.Length]; for (int i = 0; i < src.Length; i++) { result[i] = src[i] + scalar; diff --git a/tests/ImageSharp.Tests/Formats/Jpg/ZigZagTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/ZigZagTests.cs index e59584991e..61a5d8f1d8 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/ZigZagTests.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/ZigZagTests.cs @@ -12,7 +12,7 @@ public class ZigZagTests public void ZigZagCanHandleAllPossibleCoefficients() { // Mimic the behaviour of the huffman scan decoder using all possible byte values - short[] block = new short[64]; + var block = new short[64]; var zigzag = ZigZag.CreateUnzigTable(); for (int h = 0; h < 255; h++) diff --git a/tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.Chunks.cs b/tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.Chunks.cs index 6a0119f0f1..e976d5a768 100644 --- a/tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.Chunks.cs +++ b/tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.Chunks.cs @@ -1,4 +1,4 @@ -using System.Buffers.Binary; +using System.Buffers.Binary; using System.IO; using System.Text; @@ -96,7 +96,7 @@ public void Decode_IncorrectCRCForNonCriticalChunk_ExceptionIsThrown(uint chunkT private static string GetChunkTypeName(uint value) { - byte[] data = new byte[4]; + var data = new byte[4]; BinaryPrimitives.WriteUInt32BigEndian(data, value); @@ -125,4 +125,4 @@ private static void WriteDataChunk(MemoryStream memStream) memStream.Position = 0; } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/Helpers/ParallelHelperTests.cs b/tests/ImageSharp.Tests/Helpers/ParallelHelperTests.cs index 3468c076a5..aeadfcebb5 100644 --- a/tests/ImageSharp.Tests/Helpers/ParallelHelperTests.cs +++ b/tests/ImageSharp.Tests/Helpers/ParallelHelperTests.cs @@ -97,7 +97,7 @@ public void IterateRows_OverMinimumPixelsLimit_ShouldVisitAllRows( int[] expectedData = Enumerable.Repeat(0, minY).Concat(Enumerable.Range(minY, maxY - minY)).ToArray(); - int[] actualData = new int[maxY]; + var actualData = new int[maxY]; ParallelHelper.IterateRows( rectangle, @@ -172,7 +172,7 @@ public void IterateRowsWithTempBuffer_OverMinimumPixelsLimit_ShouldVisitAllRows( var rectangle = new Rectangle(0, minY, 10, maxY - minY); int[] expectedData = Enumerable.Repeat(0, minY).Concat(Enumerable.Range(minY, maxY - minY)).ToArray(); - int[] actualData = new int[maxY]; + var actualData = new int[maxY]; ParallelHelper.IterateRowsWithTempBuffer( rectangle, diff --git a/tests/ImageSharp.Tests/Helpers/RowIntervalTests.cs b/tests/ImageSharp.Tests/Helpers/RowIntervalTests.cs index 3aead6aaa9..45067f82fe 100644 --- a/tests/ImageSharp.Tests/Helpers/RowIntervalTests.cs +++ b/tests/ImageSharp.Tests/Helpers/RowIntervalTests.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; @@ -24,7 +24,7 @@ public void GetMultiRowSpan(int width, int height, int min, int max) var rows = new RowInterval(min, max); Span span = buffer.GetMultiRowSpan(rows); - + ref int expected0 = ref buffer.Span[min * width]; int expectedLength = (max - min) * width; @@ -38,9 +38,9 @@ public void GetMultiRowSpan(int width, int height, int min, int max) [Fact] public void Slice1() { - RowInterval rowInterval = new RowInterval(10, 20); + var rowInterval = new RowInterval(10, 20); RowInterval sliced = rowInterval.Slice(5); - + Assert.Equal(15, sliced.Min); Assert.Equal(20, sliced.Max); } @@ -48,9 +48,9 @@ public void Slice1() [Fact] public void Slice2() { - RowInterval rowInterval = new RowInterval(10, 20); + var rowInterval = new RowInterval(10, 20); RowInterval sliced = rowInterval.Slice(3, 5); - + Assert.Equal(13, sliced.Min); Assert.Equal(18, sliced.Max); } @@ -58,9 +58,9 @@ public void Slice2() [Fact] public void Equality_WhenTrue() { - RowInterval a = new RowInterval(42, 123); - RowInterval b = new RowInterval(42, 123); - + var a = new RowInterval(42, 123); + var b = new RowInterval(42, 123); + Assert.True(a.Equals(b)); Assert.True(a.Equals((object)b)); Assert.True(a == b); @@ -70,14 +70,14 @@ public void Equality_WhenTrue() [Fact] public void Equality_WhenFalse() { - RowInterval a = new RowInterval(42, 123); - RowInterval b = new RowInterval(42, 125); - RowInterval c = new RowInterval(40, 123); - + var a = new RowInterval(42, 123); + var b = new RowInterval(42, 125); + var c = new RowInterval(40, 123); + Assert.False(a.Equals(b)); Assert.False(c.Equals(a)); Assert.False(b.Equals(c)); - + Assert.False(a.Equals((object)b)); Assert.False(a.Equals(null)); Assert.False(a == b); diff --git a/tests/ImageSharp.Tests/IO/DoubleBufferedStreamReaderTests.cs b/tests/ImageSharp.Tests/IO/DoubleBufferedStreamReaderTests.cs index 4fac8d9546..2d5e81173b 100644 --- a/tests/ImageSharp.Tests/IO/DoubleBufferedStreamReaderTests.cs +++ b/tests/ImageSharp.Tests/IO/DoubleBufferedStreamReaderTests.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; @@ -83,7 +83,7 @@ public void DoubleBufferedStreamReaderCanReadMultipleBytesFromOrigin() { using (MemoryStream stream = this.CreateTestStream()) { - byte[] buffer = new byte[2]; + var buffer = new byte[2]; byte[] expected = stream.ToArray(); var reader = new DoubleBufferedStreamReader(this.allocator, stream); @@ -102,7 +102,7 @@ public void DoubleBufferedStreamReaderCanReadSubsequentMultipleByteCorrectly() { using (MemoryStream stream = this.CreateTestStream()) { - byte[] buffer = new byte[2]; + var buffer = new byte[2]; byte[] expected = stream.ToArray(); var reader = new DoubleBufferedStreamReader(this.allocator, stream); @@ -167,7 +167,7 @@ public void DoubleBufferedStreamReaderCanSkip() private MemoryStream CreateTestStream() { - byte[] buffer = new byte[DoubleBufferedStreamReader.ChunkLength * 3]; + var buffer = new byte[DoubleBufferedStreamReader.ChunkLength * 3]; var random = new Random(); random.NextBytes(buffer); diff --git a/tests/ImageSharp.Tests/Image/ImageCloneTests.cs b/tests/ImageSharp.Tests/Image/ImageCloneTests.cs index 66081348af..035babcb8b 100644 --- a/tests/ImageSharp.Tests/Image/ImageCloneTests.cs +++ b/tests/ImageSharp.Tests/Image/ImageCloneTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; using Xunit; @@ -10,7 +10,7 @@ public class ImageCloneTests [Fact] public void CloneAs_WhenDisposed_Throws() { - Image image = new Image(5, 5); + var image = new Image(5, 5); image.Dispose(); Assert.Throws(() => image.CloneAs()); @@ -19,7 +19,7 @@ public void CloneAs_WhenDisposed_Throws() [Fact] public void Clone_WhenDisposed_Throws() { - Image image = new Image(5, 5); + var image = new Image(5, 5); image.Dispose(); Assert.Throws(() => image.Clone()); diff --git a/tests/ImageSharp.Tests/Image/ImageFrameCollectionTests.NonGeneric.cs b/tests/ImageSharp.Tests/Image/ImageFrameCollectionTests.NonGeneric.cs index 92c5915ff6..e972012e29 100644 --- a/tests/ImageSharp.Tests/Image/ImageFrameCollectionTests.NonGeneric.cs +++ b/tests/ImageSharp.Tests/Image/ImageFrameCollectionTests.NonGeneric.cs @@ -24,7 +24,7 @@ public class NonGeneric : ImageFrameCollectionTests [Fact] public void AddFrame_OfDifferentPixelType() { - using (Image sourceImage = new Image( + using (var sourceImage = new Image( this.Image.GetConfiguration(), this.Image.Width, this.Image.Height, @@ -37,7 +37,7 @@ public void AddFrame_OfDifferentPixelType() Enumerable.Repeat(Rgba32.Blue, this.Image.Width * this.Image.Height).ToArray(); Assert.Equal(2, this.Collection.Count); - ImageFrame actualFrame = (ImageFrame)this.Collection[1]; + var actualFrame = (ImageFrame)this.Collection[1]; actualFrame.ComparePixelBufferTo(expectedAllBlue); } @@ -45,7 +45,7 @@ public void AddFrame_OfDifferentPixelType() [Fact] public void InsertFrame_OfDifferentPixelType() { - using (Image sourceImage = new Image( + using (var sourceImage = new Image( this.Image.GetConfiguration(), this.Image.Width, this.Image.Height, @@ -58,7 +58,7 @@ public void InsertFrame_OfDifferentPixelType() Enumerable.Repeat(Rgba32.Blue, this.Image.Width * this.Image.Height).ToArray(); Assert.Equal(2, this.Collection.Count); - ImageFrame actualFrame = (ImageFrame)this.Collection[0]; + var actualFrame = (ImageFrame)this.Collection[0]; actualFrame.ComparePixelBufferTo(expectedAllBlue); @@ -160,7 +160,7 @@ public void CloneFrame(TestImageProvider provider) { Assert.Equal(2, img.Frames.Count); - Image expectedClone = (Image)cloned; + var expectedClone = (Image)cloned; expectedClone.ComparePixelBufferTo(img.GetPixelSpan()); } @@ -183,7 +183,7 @@ public void ExtractFrame(TestImageProvider provider) { Assert.Equal(1, img.Frames.Count); - Image expectedClone = (Image)cloned; + var expectedClone = (Image)cloned; expectedClone.ComparePixelBufferTo(sourcePixelData); } } @@ -196,7 +196,7 @@ public void CreateFrame_Default() Assert.Equal(2, this.Image.Frames.Count); - ImageFrame frame = (ImageFrame)this.Image.Frames[1]; + var frame = (ImageFrame)this.Image.Frames[1]; frame.ComparePixelBufferTo(default(Rgba32)); } @@ -208,7 +208,7 @@ public void CreateFrame_CustomFillColor() Assert.Equal(2, this.Image.Frames.Count); - ImageFrame frame = (ImageFrame)this.Image.Frames[1]; + var frame = (ImageFrame)this.Image.Frames[1]; frame.ComparePixelBufferTo(Rgba32.HotPink); } @@ -273,7 +273,7 @@ public void ConstructGif_FromDifferentPixelTypes(TestImageProvider { using (Image source = provider.GetImage()) - using (Image dest = new Image(source.GetConfiguration(), source.Width, source.Height)) + using (var dest = new Image(source.GetConfiguration(), source.Width, source.Height)) { // Giphy.gif has 5 frames diff --git a/tests/ImageSharp.Tests/Image/ImageSaveTests.cs b/tests/ImageSharp.Tests/Image/ImageSaveTests.cs index f5504fac26..25bc3f6049 100644 --- a/tests/ImageSharp.Tests/Image/ImageSaveTests.cs +++ b/tests/ImageSharp.Tests/Image/ImageSaveTests.cs @@ -48,7 +48,7 @@ public ImageSaveTests() [Fact] public void SavePath() { - Stream stream = new MemoryStream(); + var stream = new MemoryStream(); this.fileSystem.Setup(x => x.Create("path.png")).Returns(stream); this.Image.Save("path.png"); @@ -59,7 +59,7 @@ public void SavePath() [Fact] public void SavePathWithEncoder() { - Stream stream = new MemoryStream(); + var stream = new MemoryStream(); this.fileSystem.Setup(x => x.Create("path.jpg")).Returns(stream); this.Image.Save("path.jpg", this.encoderNotInFormat.Object); @@ -78,7 +78,7 @@ public void ToBase64String() [Fact] public void SaveStreamWithMime() { - Stream stream = new MemoryStream(); + var stream = new MemoryStream(); this.Image.Save(stream, this.localImageFormat.Object); this.encoder.Verify(x => x.Encode(this.Image, stream)); @@ -87,7 +87,7 @@ public void SaveStreamWithMime() [Fact] public void SaveStreamWithEncoder() { - Stream stream = new MemoryStream(); + var stream = new MemoryStream(); this.Image.Save(stream, this.encoderNotInFormat.Object); diff --git a/tests/ImageSharp.Tests/Image/ImageTests.Load_FromBytes_PassLocalConfiguration.cs b/tests/ImageSharp.Tests/Image/ImageTests.Load_FromBytes_PassLocalConfiguration.cs index ad8dc20e43..2b1411fa63 100644 --- a/tests/ImageSharp.Tests/Image/ImageTests.Load_FromBytes_PassLocalConfiguration.cs +++ b/tests/ImageSharp.Tests/Image/ImageTests.Load_FromBytes_PassLocalConfiguration.cs @@ -32,7 +32,7 @@ public void Configuration_Bytes_Specific(bool useSpan) this.TestFormat.VerifySpecificDecodeCall(this.Marker, this.TopLevelConfiguration); } - + [Theory] [InlineData(false)] [InlineData(true)] @@ -47,14 +47,14 @@ public void Configuration_Bytes_Agnostic(bool useSpan) this.TestFormat.VerifyAgnosticDecodeCall(this.Marker, this.TopLevelConfiguration); } - + [Theory] [InlineData(false)] [InlineData(true)] public void Configuration_Bytes_Decoder_Specific(bool useSpan) { - TestFormat localFormat = new TestFormat(); - + var localFormat = new TestFormat(); + var img = useSpan ? Image.Load(this.TopLevelConfiguration, this.ByteSpan, localFormat.Decoder) : Image.Load(this.TopLevelConfiguration, this.ByteArray, localFormat.Decoder); @@ -62,14 +62,14 @@ public void Configuration_Bytes_Decoder_Specific(bool useSpan) Assert.NotNull(img); localFormat.VerifySpecificDecodeCall(this.Marker, this.TopLevelConfiguration); } - + [Theory] [InlineData(false)] [InlineData(true)] public void Configuration_Bytes_Decoder_Agnostic(bool useSpan) { - TestFormat localFormat = new TestFormat(); - + var localFormat = new TestFormat(); + var img = useSpan ? Image.Load(this.TopLevelConfiguration, this.ByteSpan, localFormat.Decoder) : Image.Load(this.TopLevelConfiguration, this.ByteArray, localFormat.Decoder); @@ -90,10 +90,10 @@ public void Configuration_Bytes_OutFormat_Specific(bool useSpan) Assert.NotNull(img); Assert.Equal(this.TestFormat, format); - + this.TestFormat.VerifySpecificDecodeCall(this.Marker, this.TopLevelConfiguration); } - + [Theory] [InlineData(false)] [InlineData(true)] @@ -106,7 +106,7 @@ public void Configuration_Bytes_OutFormat_Agnostic(bool useSpan) Assert.NotNull(img); Assert.Equal(this.TestFormat, format); - + this.TestFormat.VerifyAgnosticDecodeCall(this.Marker, this.TopLevelConfiguration); } } diff --git a/tests/ImageSharp.Tests/Image/ImageTests.Load_FromStream_PassLocalConfiguration.cs b/tests/ImageSharp.Tests/Image/ImageTests.Load_FromStream_PassLocalConfiguration.cs index 5ca86c3cee..4e91cfebce 100644 --- a/tests/ImageSharp.Tests/Image/ImageTests.Load_FromStream_PassLocalConfiguration.cs +++ b/tests/ImageSharp.Tests/Image/ImageTests.Load_FromStream_PassLocalConfiguration.cs @@ -24,7 +24,7 @@ public void Configuration_Stream_Specific() this.TestFormat.VerifySpecificDecodeCall(this.Marker, this.TopLevelConfiguration); } - + [Fact] public void Configuration_Stream_Agnostic() { @@ -35,7 +35,7 @@ public void Configuration_Stream_Agnostic() this.TestFormat.VerifyAgnosticDecodeCall(this.Marker, this.TopLevelConfiguration); } - + [Fact] public void NonSeekableStream() { @@ -46,21 +46,21 @@ public void NonSeekableStream() this.TestFormat.VerifySpecificDecodeCall(this.Marker, this.TopLevelConfiguration); } - + [Fact] public void Configuration_Stream_Decoder_Specific() { - Stream stream = new MemoryStream(); + var stream = new MemoryStream(); var img = Image.Load(this.TopLevelConfiguration, stream, this.localDecoder.Object); Assert.NotNull(img); this.localDecoder.Verify(x => x.Decode(this.TopLevelConfiguration, stream)); } - + [Fact] public void Configuration_Stream_Decoder_Agnostic() { - Stream stream = new MemoryStream(); + var stream = new MemoryStream(); var img = Image.Load(this.TopLevelConfiguration, stream, this.localDecoder.Object); Assert.NotNull(img); @@ -74,10 +74,10 @@ public void Configuration_Stream_OutFormat_Specific() Assert.NotNull(img); Assert.Equal(this.TestFormat, format); - + this.TestFormat.VerifySpecificDecodeCall(this.Marker, this.TopLevelConfiguration); } - + [Fact] public void Configuration_Stream_OutFormat_Agnostic() { @@ -85,9 +85,9 @@ public void Configuration_Stream_OutFormat_Agnostic() Assert.NotNull(img); Assert.Equal(this.TestFormat, format); - + this.TestFormat.VerifyAgnosticDecodeCall(this.Marker, this.TopLevelConfiguration); - } + } } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/Image/ImageTests.Save.cs b/tests/ImageSharp.Tests/Image/ImageTests.Save.cs index 61f6945183..e00a70e392 100644 --- a/tests/ImageSharp.Tests/Image/ImageTests.Save.cs +++ b/tests/ImageSharp.Tests/Image/ImageTests.Save.cs @@ -76,7 +76,7 @@ public void ThrowsWhenDisposed() var image = new Image(5, 5); image.Dispose(); IImageEncoder encoder = Mock.Of(); - using (MemoryStream stream = new MemoryStream()) + using (var stream = new MemoryStream()) { Assert.Throws(() => image.Save(stream, encoder)); } diff --git a/tests/ImageSharp.Tests/ImageOperationTests.cs b/tests/ImageSharp.Tests/ImageOperationTests.cs index 20c3b728fb..d2dc95cfe8 100644 --- a/tests/ImageSharp.Tests/ImageOperationTests.cs +++ b/tests/ImageSharp.Tests/ImageOperationTests.cs @@ -29,7 +29,7 @@ public ImageOperationTests() { this.provider = new FakeImageOperationsProvider(); - Mock processorMock = new Mock(); + var processorMock = new Mock(); this.processorDefinition = processorMock.Object; this.image = new Image(new Configuration @@ -155,7 +155,7 @@ private static string GetExpectedExceptionText() { try { - Image img = new Image(1, 1); + var img = new Image(1, 1); img.Dispose(); img.EnsureNotDisposed(); } diff --git a/tests/ImageSharp.Tests/Memory/Buffer2DTests.cs b/tests/ImageSharp.Tests/Memory/Buffer2DTests.cs index abe78e747e..ee32be3ca7 100644 --- a/tests/ImageSharp.Tests/Memory/Buffer2DTests.cs +++ b/tests/ImageSharp.Tests/Memory/Buffer2DTests.cs @@ -137,11 +137,11 @@ public void SwapOrCopyContent() [InlineData(5, 1, 1, 3, 2)] public void CopyColumns(int width, int height, int startIndex, int destIndex, int columnCount) { - Random rnd = new Random(123); + var rnd = new Random(123); using (Buffer2D b = this.MemoryAllocator.Allocate2D(width, height)) { rnd.RandomFill(b.Span, 0, 1); - + b.CopyColumns(startIndex, destIndex, columnCount); for (int y = 0; y < b.Height; y++) @@ -150,7 +150,7 @@ public void CopyColumns(int width, int height, int startIndex, int destIndex, in Span s = row.Slice(startIndex, columnCount); Span d = row.Slice(destIndex, columnCount); - + Xunit.Assert.True(s.SequenceEqual(d)); } } @@ -159,11 +159,11 @@ public void CopyColumns(int width, int height, int startIndex, int destIndex, in [Fact] public void CopyColumns_InvokeMultipleTimes() { - Random rnd = new Random(123); + var rnd = new Random(123); using (Buffer2D b = this.MemoryAllocator.Allocate2D(100, 100)) { rnd.RandomFill(b.Span, 0, 1); - + b.CopyColumns(0, 50, 22); b.CopyColumns(0, 50, 22); @@ -173,7 +173,7 @@ public void CopyColumns_InvokeMultipleTimes() Span s = row.Slice(0, 22); Span d = row.Slice(50, 22); - + Xunit.Assert.True(s.SequenceEqual(d)); } } diff --git a/tests/ImageSharp.Tests/Memory/BufferAreaTests.cs b/tests/ImageSharp.Tests/Memory/BufferAreaTests.cs index dc735e41b4..9192798628 100644 --- a/tests/ImageSharp.Tests/Memory/BufferAreaTests.cs +++ b/tests/ImageSharp.Tests/Memory/BufferAreaTests.cs @@ -44,7 +44,7 @@ public void Indexer(int rx, int ry, int x, int y) { using (Buffer2D buffer = CreateTestBuffer(20, 30)) { - Rectangle r = new Rectangle(rx, ry, 5, 6); + var r = new Rectangle(rx, ry, 5, 6); BufferArea area = buffer.GetArea(r); @@ -61,7 +61,7 @@ public void GetRowSpan(int rx, int ry, int y, int w, int h) { using (Buffer2D buffer = CreateTestBuffer(20, 30)) { - Rectangle r = new Rectangle(rx, ry, w, h); + var r = new Rectangle(rx, ry, w, h); BufferArea area = buffer.GetArea(r); @@ -145,4 +145,4 @@ public void Clear_SubArea() } } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/IccProfileTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/IccProfileTests.cs index 52d88afafc..633c7c8230 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/IccProfileTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/IccProfileTests.cs @@ -22,7 +22,7 @@ public void CalculateHash_WithByteArray_CalculatesProfileHash(byte[] data, IccPr public void CalculateHash_WithByteArray_DoesNotModifyData() { byte[] data = IccTestDataProfiles.Profile_Random_Array; - byte[] copy = new byte[data.Length]; + var copy = new byte[data.Length]; Buffer.BlockCopy(data, 0, copy, 0, data.Length); IccProfile.CalculateHash(data); diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/IccWriterTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/IccWriterTests.cs index 33ecf53c71..e66554b85b 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/IccWriterTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/IccWriterTests.cs @@ -13,12 +13,12 @@ public void WriteProfile_NoEntries() { IccWriter writer = CreateWriter(); - IccProfile profile = new IccProfile + var profile = new IccProfile { Header = IccTestDataProfiles.Header_Random_Write }; byte[] output = writer.Write(profile); - + Assert.Equal(IccTestDataProfiles.Header_Random_Array, output); } @@ -28,7 +28,7 @@ public void WriteProfile_DuplicateEntry() IccWriter writer = CreateWriter(); byte[] output = writer.Write(IccTestDataProfiles.Profile_Random_Val); - + Assert.Equal(IccTestDataProfiles.Profile_Random_Array, output); } diff --git a/tests/ImageSharp.Tests/PixelFormats/PixelOperations/PixelOperationsTests.cs b/tests/ImageSharp.Tests/PixelFormats/PixelOperations/PixelOperationsTests.cs index 58242713cc..682da89fcc 100644 --- a/tests/ImageSharp.Tests/PixelFormats/PixelOperations/PixelOperationsTests.cs +++ b/tests/ImageSharp.Tests/PixelFormats/PixelOperations/PixelOperationsTests.cs @@ -297,7 +297,7 @@ public void Generic_To(TDestPixel dummy) { const int Count = 2134; TPixel[] source = CreatePixelTestData(Count); - TDestPixel[] expected = new TDestPixel[Count]; + var expected = new TDestPixel[Count]; PixelConverterTests.ReferenceImplementations.To(this.Configuration, source, expected); @@ -457,7 +457,7 @@ public void FromArgb32Bytes(int count) public void ToArgb32Bytes(int count) { TPixel[] source = CreatePixelTestData(count); - byte[] expected = new byte[count * 4]; + var expected = new byte[count * 4]; var argb = default(Argb32); for (int i = 0; i < count; i++) @@ -504,7 +504,7 @@ public void FromBgr24Bytes(int count) public void ToBgr24Bytes(int count) { TPixel[] source = CreatePixelTestData(count); - byte[] expected = new byte[count * 3]; + var expected = new byte[count * 3]; var bgr = default(Bgr24); for (int i = 0; i < count; i++) @@ -549,7 +549,7 @@ public void FromBgra32Bytes(int count) public void ToBgra32Bytes(int count) { TPixel[] source = CreatePixelTestData(count); - byte[] expected = new byte[count * 4]; + var expected = new byte[count * 4]; var bgra = default(Bgra32); for (int i = 0; i < count; i++) @@ -595,7 +595,7 @@ public void FromRgb24Bytes(int count) public void ToRgb24Bytes(int count) { TPixel[] source = CreatePixelTestData(count); - byte[] expected = new byte[count * 3]; + var expected = new byte[count * 3]; var rgb = default(Rgb24); for (int i = 0; i < count; i++) @@ -640,7 +640,7 @@ public void FromRgba32Bytes(int count) public void ToRgba32Bytes(int count) { TPixel[] source = CreatePixelTestData(count); - byte[] expected = new byte[count * 4]; + var expected = new byte[count * 4]; var rgba = default(Rgba32); for (int i = 0; i < count; i++) @@ -686,7 +686,7 @@ public void FromRgb48Bytes(int count) public void ToRgb48Bytes(int count) { TPixel[] source = CreatePixelTestData(count); - byte[] expected = new byte[count * 6]; + var expected = new byte[count * 6]; Rgb48 rgb = default; for (int i = 0; i < count; i++) @@ -735,7 +735,7 @@ public void FromRgba64Bytes(int count) public void ToRgba64Bytes(int count) { TPixel[] source = CreatePixelTestData(count); - byte[] expected = new byte[count * 8]; + var expected = new byte[count * 8]; Rgba64 rgba = default; for (int i = 0; i < count; i++) @@ -787,7 +787,7 @@ public void FromGray8(int count) public void ToGray8(int count) { TPixel[] source = CreatePixelTestData(count); - Gray8[] expected = new Gray8[count]; + var expected = new Gray8[count]; for (int i = 0; i < count; i++) { @@ -831,7 +831,7 @@ public void FromGray16(int count) public void ToGray16(int count) { TPixel[] source = CreatePixelTestData(count); - Gray16[] expected = new Gray16[count]; + var expected = new Gray16[count]; for (int i = 0; i < count; i++) { @@ -946,7 +946,7 @@ internal static TPixel[] CreateScaledPixelTestData(int length, RefAction(TestImageProvider x.AutoOrient()); image.DebugSave(provider, orientation, appendPixelTypeToFileName: false); image.CompareToReferenceOutput(provider, orientation, appendPixelTypeToFileName: false); @@ -71,8 +71,8 @@ public void AutoOrient_WorksWithCorruptExifData(TestImageProvider(TestImageProvider provider) public void ImageShouldPadWithBackgroundColor(TestImageProvider provider) where TPixel : struct, IPixel { - Color color = Color.Red; + var color = Color.Red; TPixel expected = color.ToPixel(); using (Image image = provider.GetImage()) { @@ -58,4 +58,4 @@ public void ImageShouldPadWithBackgroundColor(TestImageProvider } } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeKernelMapTests.ReferenceKernelMap.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeKernelMapTests.ReferenceKernelMap.cs index 2c5914253a..1681c3046a 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeKernelMapTests.ReferenceKernelMap.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeKernelMapTests.ReferenceKernelMap.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.Collections.Generic; @@ -61,7 +61,7 @@ public static ReferenceKernelMap Calculate(IResampler sampler, int destinationSi double sum = 0; - double[] values = new double[right - left + 1]; + var values = new double[right - left + 1]; for (int j = left; j <= right; j++) { @@ -108,4 +108,4 @@ public static implicit operator ReferenceKernel(ResizeKernel orig) } } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/TestUtilities/Attributes/ImageDataAttributeBase.cs b/tests/ImageSharp.Tests/TestUtilities/Attributes/ImageDataAttributeBase.cs index ee1665138a..f03d68307b 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Attributes/ImageDataAttributeBase.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Attributes/ImageDataAttributeBase.cs @@ -102,7 +102,7 @@ private IEnumerable InnerGetData(MethodInfo testMethod, IEnumerable InnerGetData(MethodInfo testMethod, IEnumerable pixels) int pixelCount = left * top; uint stepsPerPixel = (uint)(uint.MaxValue / pixelCount); TPixel c = default; - Rgba32 t = new Rgba32(0); + var t = new Rgba32(0); for (int x = left; x < right; x++) { diff --git a/tests/ImageSharp.Tests/TestUtilities/TestDataGenerator.cs b/tests/ImageSharp.Tests/TestUtilities/TestDataGenerator.cs index 4ccb387451..7c29ac4db0 100644 --- a/tests/ImageSharp.Tests/TestUtilities/TestDataGenerator.cs +++ b/tests/ImageSharp.Tests/TestUtilities/TestDataGenerator.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; @@ -21,7 +21,7 @@ internal static class TestDataGenerator /// The . public static float[] GenerateRandomFloatArray(this Random rnd, int length, float minVal, float maxVal) { - float[] values = new float[length]; + var values = new float[length]; RandomFill(rnd, values, minVal, maxVal); @@ -70,7 +70,7 @@ public static Vector4[] GenerateRandomVectorArray(this Random rnd, int length, f /// The . public static float[] GenerateRandomRoundedFloatArray(this Random rnd, int length, float minVal, float maxVal) { - float[] values = new float[length]; + var values = new float[length]; for (int i = 0; i < length; i++) { @@ -88,14 +88,14 @@ public static float[] GenerateRandomRoundedFloatArray(this Random rnd, int lengt /// The . public static byte[] GenerateRandomByteArray(this Random rnd, int length) { - byte[] values = new byte[length]; + var values = new byte[length]; rnd.NextBytes(values); return values; } public static short[] GenerateRandomInt16Array(this Random rnd, int length, short minVal, short maxVal) { - short[] values = new short[length]; + var values = new short[length]; for (int i = 0; i < values.Length; i++) { values[i] = (short)rnd.Next(minVal, maxVal); @@ -106,4 +106,4 @@ public static short[] GenerateRandomInt16Array(this Random rnd, int length, shor private static float GetRandomFloat(this Random rnd, float minVal, float maxVal) => ((float)rnd.NextDouble() * (maxVal - minVal)) + minVal; } -} \ No newline at end of file +}