From 3c2cc0c52efcb59799d98b524f2dda6ea3b8a4f4 Mon Sep 17 00:00:00 2001 From: Brian Popow Date: Fri, 8 Oct 2021 11:41:42 +0200 Subject: [PATCH] Fix warnings --- .../Formats/WebP/BitReader/BitReaderBase.cs | 1 - .../WebP/Lossless/BackwardReferenceEncoder.cs | 2 +- .../Formats/WebP/Lossless/LosslessUtils.cs | 211 +++++++++--------- .../Formats/WebP/Lossless/NearLosslessEnc.cs | 4 +- .../Formats/WebP/Lossless/PredictorEncoder.cs | 10 +- .../WebP/Lossless/WebpLosslessDecoder.cs | 3 +- .../Formats/WebP/Lossy/Vp8EncIterator.cs | 3 +- .../Formats/WebP/Lossy/Vp8Encoder.cs | 1 - .../Formats/WebP/Lossy/WebpLossyDecoder.cs | 1 - .../Formats/WebP/Lossy/YuvConversion.cs | 22 +- src/ImageSharp/Formats/WebP/WebpDecoder.cs | 1 - .../Formats/WebP/WebpLookupTables.cs | 2 +- .../Formats/WebP/WebpDecoderTests.cs | 7 +- 13 files changed, 134 insertions(+), 134 deletions(-) diff --git a/src/ImageSharp/Formats/WebP/BitReader/BitReaderBase.cs b/src/ImageSharp/Formats/WebP/BitReader/BitReaderBase.cs index 76a2f11281..47d1581237 100644 --- a/src/ImageSharp/Formats/WebP/BitReader/BitReaderBase.cs +++ b/src/ImageSharp/Formats/WebP/BitReader/BitReaderBase.cs @@ -4,7 +4,6 @@ using System; using System.Buffers; using System.IO; - using SixLabors.ImageSharp.Memory; namespace SixLabors.ImageSharp.Formats.Webp.BitReader diff --git a/src/ImageSharp/Formats/WebP/Lossless/BackwardReferenceEncoder.cs b/src/ImageSharp/Formats/WebP/Lossless/BackwardReferenceEncoder.cs index ea9752db8c..a370826380 100644 --- a/src/ImageSharp/Formats/WebP/Lossless/BackwardReferenceEncoder.cs +++ b/src/ImageSharp/Formats/WebP/Lossless/BackwardReferenceEncoder.cs @@ -639,7 +639,7 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossless { // Figure out if we should use the offset/length from the previous pixel // as an initial guess and therefore only inspect the offsets in windowOffsetsNew[]. - bool usePrev = bestLengthPrev > 1 && bestLengthPrev < MaxLength; + bool usePrev = bestLengthPrev is > 1 and < MaxLength; int numInd = usePrev ? windowOffsetsNewSize : windowOffsetsSize; bestLength = usePrev ? bestLengthPrev - 1 : 0; bestOffset = usePrev ? bestOffsetPrev : 0; diff --git a/src/ImageSharp/Formats/WebP/Lossless/LosslessUtils.cs b/src/ImageSharp/Formats/WebP/Lossless/LosslessUtils.cs index dc6f4843b1..15bd8c5e63 100644 --- a/src/ImageSharp/Formats/WebP/Lossless/LosslessUtils.cs +++ b/src/ImageSharp/Formats/WebP/Lossless/LosslessUtils.cs @@ -5,7 +5,6 @@ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using SixLabors.ImageSharp.Memory; - #if SUPPORTS_RUNTIME_INTRINSICS using System.Runtime.Intrinsics; using System.Runtime.Intrinsics.X86; @@ -67,30 +66,26 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossless { if (distance < PrefixLookupIdxMax) { - (int code, int extraBits) prefixCode = WebpLookupTables.PrefixEncodeCode[distance]; - extraBits = prefixCode.extraBits; - return prefixCode.code; - } - else - { - return PrefixEncodeBitsNoLut(distance, ref extraBits); + (int Code, int ExtraBits) prefixCode = WebpLookupTables.PrefixEncodeCode[distance]; + extraBits = prefixCode.ExtraBits; + return prefixCode.Code; } + + return PrefixEncodeBitsNoLut(distance, ref extraBits); } public static int PrefixEncode(int distance, ref int extraBits, ref int extraBitsValue) { if (distance < PrefixLookupIdxMax) { - (int code, int extraBits) prefixCode = WebpLookupTables.PrefixEncodeCode[distance]; - extraBits = prefixCode.extraBits; + (int Code, int ExtraBits) prefixCode = WebpLookupTables.PrefixEncodeCode[distance]; + extraBits = prefixCode.ExtraBits; extraBitsValue = WebpLookupTables.PrefixEncodeExtraBitsValue[distance]; - return prefixCode.code; - } - else - { - return PrefixEncodeNoLut(distance, ref extraBits, ref extraBitsValue); + return prefixCode.Code; } + + return PrefixEncodeNoLut(distance, ref extraBits, ref extraBitsValue); } /// @@ -402,9 +397,9 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossless var maskalphagreen = Vector128.Create(0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255); var maskredblue = Vector128.Create(255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0); byte shufflemask = SimdUtils.Shuffle.MmShuffle(2, 2, 0, 0); - int idx; fixed (uint* src = data) { + int idx; for (idx = 0; idx + 4 <= numPixels; idx += 4) { uint* pos = src + idx; @@ -535,104 +530,106 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossless Span outputSpan) { fixed (uint* inputFixed = pixelData) - fixed (uint* outputFixed = outputSpan) { - uint* input = inputFixed; - uint* output = outputFixed; - - int width = transform.XSize; - Span transformData = transform.Data.GetSpan(); - - // First Row follows the L (mode=1) mode. - PredictorAdd0(input, 1, output); - PredictorAdd1(input + 1, width - 1, output + 1); - input += width; - output += width; - - int y = 1; - int yEnd = transform.YSize; - int tileWidth = 1 << transform.Bits; - int mask = tileWidth - 1; - int tilesPerRow = SubSampleSize(width, transform.Bits); - int predictorModeIdxBase = (y >> transform.Bits) * tilesPerRow; - while (y < yEnd) + fixed (uint* outputFixed = outputSpan) { - int predictorModeIdx = predictorModeIdxBase; - int x = 1; + uint* input = inputFixed; + uint* output = outputFixed; - // First pixel follows the T (mode=2) mode. - PredictorAdd2(input, output - width, 1, output); + int width = transform.XSize; + Span transformData = transform.Data.GetSpan(); - // .. the rest: - while (x < width) + // First Row follows the L (mode=1) mode. + PredictorAdd0(input, 1, output); + PredictorAdd1(input + 1, width - 1, output + 1); + input += width; + output += width; + + int y = 1; + int yEnd = transform.YSize; + int tileWidth = 1 << transform.Bits; + int mask = tileWidth - 1; + int tilesPerRow = SubSampleSize(width, transform.Bits); + int predictorModeIdxBase = (y >> transform.Bits) * tilesPerRow; + while (y < yEnd) { - uint predictorMode = (transformData[predictorModeIdx++] >> 8) & 0xf; - int xEnd = (x & ~mask) + tileWidth; - if (xEnd > width) - { - xEnd = width; - } + int predictorModeIdx = predictorModeIdxBase; + int x = 1; + + // First pixel follows the T (mode=2) mode. + PredictorAdd2(input, output - width, 1, output); - // There are 14 different prediction modes. - // In each prediction mode, the current pixel value is predicted from one - // or more neighboring pixels whose values are already known. - switch (predictorMode) + // .. the rest: + while (x < width) { - case 0: - PredictorAdd0(input + x, xEnd - x, output + x); - break; - case 1: - PredictorAdd1(input + x, xEnd - x, output + x); - break; - case 2: - PredictorAdd2(input + x, output + x - width, xEnd - x, output + x); - break; - case 3: - PredictorAdd3(input + x, output + x - width, xEnd - x, output + x); - break; - case 4: - PredictorAdd4(input + x, output + x - width, xEnd - x, output + x); - break; - case 5: - PredictorAdd5(input + x, output + x - width, xEnd - x, output + x); - break; - case 6: - PredictorAdd6(input + x, output + x - width, xEnd - x, output + x); - break; - case 7: - PredictorAdd7(input + x, output + x - width, xEnd - x, output + x); - break; - case 8: - PredictorAdd8(input + x, output + x - width, xEnd - x, output + x); - break; - case 9: - PredictorAdd9(input + x, output + x - width, xEnd - x, output + x); - break; - case 10: - PredictorAdd10(input + x, output + x - width, xEnd - x, output + x); - break; - case 11: - PredictorAdd11(input + x, output + x - width, xEnd - x, output + x); - break; - case 12: - PredictorAdd12(input + x, output + x - width, xEnd - x, output + x); - break; - case 13: - PredictorAdd13(input + x, output + x - width, xEnd - x, output + x); - break; + uint predictorMode = (transformData[predictorModeIdx++] >> 8) & 0xf; + int xEnd = (x & ~mask) + tileWidth; + if (xEnd > width) + { + xEnd = width; + } + + // There are 14 different prediction modes. + // In each prediction mode, the current pixel value is predicted from one + // or more neighboring pixels whose values are already known. + switch (predictorMode) + { + case 0: + PredictorAdd0(input + x, xEnd - x, output + x); + break; + case 1: + PredictorAdd1(input + x, xEnd - x, output + x); + break; + case 2: + PredictorAdd2(input + x, output + x - width, xEnd - x, output + x); + break; + case 3: + PredictorAdd3(input + x, output + x - width, xEnd - x, output + x); + break; + case 4: + PredictorAdd4(input + x, output + x - width, xEnd - x, output + x); + break; + case 5: + PredictorAdd5(input + x, output + x - width, xEnd - x, output + x); + break; + case 6: + PredictorAdd6(input + x, output + x - width, xEnd - x, output + x); + break; + case 7: + PredictorAdd7(input + x, output + x - width, xEnd - x, output + x); + break; + case 8: + PredictorAdd8(input + x, output + x - width, xEnd - x, output + x); + break; + case 9: + PredictorAdd9(input + x, output + x - width, xEnd - x, output + x); + break; + case 10: + PredictorAdd10(input + x, output + x - width, xEnd - x, output + x); + break; + case 11: + PredictorAdd11(input + x, output + x - width, xEnd - x, output + x); + break; + case 12: + PredictorAdd12(input + x, output + x - width, xEnd - x, output + x); + break; + case 13: + PredictorAdd13(input + x, output + x - width, xEnd - x, output + x); + break; + } + + x = xEnd; } - x = xEnd; - } + input += width; + output += width; + ++y; - input += width; - output += width; - ++y; - - if ((y & mask) == 0) - { - // Use the same mask, since tiles are squares. - predictorModeIdxBase += tilesPerRow; + if ((y & mask) == 0) + { + // Use the same mask, since tiles are squares. + predictorModeIdxBase += tilesPerRow; + } } } } @@ -839,10 +836,8 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossless return (float)log2; } - else - { - return (float)(Log2Reciprocal * Math.Log(v)); - } + + return (float)(Log2Reciprocal * Math.Log(v)); } /// diff --git a/src/ImageSharp/Formats/WebP/Lossless/NearLosslessEnc.cs b/src/ImageSharp/Formats/WebP/Lossless/NearLosslessEnc.cs index 46345e728c..f71e4fd601 100644 --- a/src/ImageSharp/Formats/WebP/Lossless/NearLosslessEnc.cs +++ b/src/ImageSharp/Formats/WebP/Lossless/NearLosslessEnc.cs @@ -39,7 +39,7 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossless // Adjusts pixel values of image with given maximum error. private static void NearLossless(int xSize, int ySize, Span argbSrc, int stride, int limitBits, Span copyBuffer, Span argbDst) { - int x, y; + int y; int limit = 1 << limitBits; Span prevRow = copyBuffer; Span currRow = copyBuffer.Slice(xSize, xSize); @@ -60,7 +60,7 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossless argbSrc.Slice(srcOffset + stride, xSize).CopyTo(nextRow); argbDst[dstOffset] = argbSrc[srcOffset]; argbDst[dstOffset + xSize - 1] = argbSrc[srcOffset + xSize - 1]; - for (x = 1; x < xSize - 1; ++x) + for (int x = 1; x < xSize - 1; ++x) { if (IsSmooth(prevRow, currRow, nextRow, x, limit)) { diff --git a/src/ImageSharp/Formats/WebP/Lossless/PredictorEncoder.cs b/src/ImageSharp/Formats/WebP/Lossless/PredictorEncoder.cs index 159c0c2f85..b06ca619a1 100644 --- a/src/ImageSharp/Formats/WebP/Lossless/PredictorEncoder.cs +++ b/src/ImageSharp/Formats/WebP/Lossless/PredictorEncoder.cs @@ -341,6 +341,7 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossless } else { +#pragma warning disable SA1503 // Braces should not be omitted fixed (uint* currentRow = currentRowSpan) fixed (uint* upperRow = upperRowSpan) { @@ -454,6 +455,7 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossless } } } +#pragma warning restore SA1503 // Braces should not be omitted /// /// Quantize every component of the difference between the actual pixel value and @@ -478,7 +480,7 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossless quantization >>= 1; } - if (value >> 24 == 0 || value >> 24 == 0xff) + if (value >> 24 is 0 or 0xff) { // Preserve transparency of fully transparent or fully opaque pixels. a = NearLosslessDiff((byte)((value >> 24) & 0xff), (byte)((predict >> 24) & 0xff)); @@ -649,6 +651,7 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossless Span upperSpan, Span outputSpan) { +#pragma warning disable SA1503 // Braces should not be omitted fixed (uint* current = currentSpan) fixed (uint* upper = upperSpan) fixed (uint* outputFixed = outputSpan) @@ -727,6 +730,7 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossless } } } +#pragma warning restore SA1503 // Braces should not be omitted private static void MaxDiffsForRow(int width, int stride, Span argb, int offset, Span maxDiffs, bool usedSubtractGreen) { @@ -990,6 +994,7 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossless for (int y = 0; y < tileHeight; ++y) { Span srcSpan = bgra.Slice(y * stride); +#pragma warning disable SA1503 // Braces should not be omitted fixed (uint* src = srcSpan) fixed (ushort* dst = values) { @@ -1016,6 +1021,7 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossless } } } +#pragma warning restore SA1503 // Braces should not be omitted int leftOver = tileWidth & (span - 1); if (leftOver > 0) @@ -1063,6 +1069,7 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossless for (int y = 0; y < tileHeight; ++y) { Span srcSpan = bgra.Slice(y * stride); +#pragma warning disable SA1503 // Braces should not be omitted fixed (uint* src = srcSpan) fixed (ushort* dst = values) { @@ -1092,6 +1099,7 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossless } } } +#pragma warning restore SA1503 // Braces should not be omitted int leftOver = tileWidth & (span - 1); if (leftOver > 0) diff --git a/src/ImageSharp/Formats/WebP/Lossless/WebpLosslessDecoder.cs b/src/ImageSharp/Formats/WebP/Lossless/WebpLosslessDecoder.cs index b206c9aa77..9e05c202d4 100644 --- a/src/ImageSharp/Formats/WebP/Lossless/WebpLosslessDecoder.cs +++ b/src/ImageSharp/Formats/WebP/Lossless/WebpLosslessDecoder.cs @@ -6,7 +6,6 @@ using System.Buffers; using System.Collections.Generic; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - using SixLabors.ImageSharp.Formats.Webp.BitReader; using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.PixelFormats; @@ -147,7 +146,7 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossless // Note: According to webpinfo color cache bits of 11 are valid, even though 10 is defined in the source code as maximum. // That is why 11 bits is also considered valid here. - bool colorCacheBitsIsValid = colorCacheBits >= 1 && colorCacheBits <= WebpConstants.MaxColorCacheBits + 1; + bool colorCacheBitsIsValid = colorCacheBits is >= 1 and <= WebpConstants.MaxColorCacheBits + 1; if (!colorCacheBitsIsValid) { WebpThrowHelper.ThrowImageFormatException("Invalid color cache bits found"); diff --git a/src/ImageSharp/Formats/WebP/Lossy/Vp8EncIterator.cs b/src/ImageSharp/Formats/WebP/Lossy/Vp8EncIterator.cs index b70c733c56..779460ac4b 100644 --- a/src/ImageSharp/Formats/WebP/Lossy/Vp8EncIterator.cs +++ b/src/ImageSharp/Formats/WebP/Lossy/Vp8EncIterator.cs @@ -400,7 +400,6 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossy { byte[] modes = new byte[16]; int maxMode = MaxIntra4Mode; - int i4Alpha; var totalHisto = new Vp8Histogram(); int curHisto = 0; this.StartI4(); @@ -433,7 +432,7 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossy } while (this.RotateI4(this.YuvIn.AsSpan(YOffEnc))); // Note: we reuse the original samples for predictors. - i4Alpha = totalHisto.GetAlpha(); + var i4Alpha = totalHisto.GetAlpha(); if (i4Alpha > bestAlpha) { this.SetIntra4Mode(modes); diff --git a/src/ImageSharp/Formats/WebP/Lossy/Vp8Encoder.cs b/src/ImageSharp/Formats/WebP/Lossy/Vp8Encoder.cs index 61c4f4d1d6..81ab24a32f 100644 --- a/src/ImageSharp/Formats/WebP/Lossy/Vp8Encoder.cs +++ b/src/ImageSharp/Formats/WebP/Lossy/Vp8Encoder.cs @@ -5,7 +5,6 @@ using System; using System.Buffers; using System.IO; using System.Runtime.CompilerServices; - using SixLabors.ImageSharp.Formats.Webp.BitWriter; using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.PixelFormats; diff --git a/src/ImageSharp/Formats/WebP/Lossy/WebpLossyDecoder.cs b/src/ImageSharp/Formats/WebP/Lossy/WebpLossyDecoder.cs index 92a3a65e62..2537f714ea 100644 --- a/src/ImageSharp/Formats/WebP/Lossy/WebpLossyDecoder.cs +++ b/src/ImageSharp/Formats/WebP/Lossy/WebpLossyDecoder.cs @@ -5,7 +5,6 @@ using System; using System.Buffers; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - using SixLabors.ImageSharp.Formats.Webp.BitReader; using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.PixelFormats; diff --git a/src/ImageSharp/Formats/WebP/Lossy/YuvConversion.cs b/src/ImageSharp/Formats/WebP/Lossy/YuvConversion.cs index 797fbe3b6d..ed03c2e71d 100644 --- a/src/ImageSharp/Formats/WebP/Lossy/YuvConversion.cs +++ b/src/ImageSharp/Formats/WebP/Lossy/YuvConversion.cs @@ -140,17 +140,20 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossy GammaToLinear(bgra0.R) + GammaToLinear(bgra1.R) + GammaToLinear(bgra2.R) + - GammaToLinear(bgra3.R), 0); + GammaToLinear(bgra3.R), + 0); dst[dstIdx + 1] = (ushort)LinearToGamma( GammaToLinear(bgra0.G) + GammaToLinear(bgra1.G) + GammaToLinear(bgra2.G) + - GammaToLinear(bgra3.G), 0); + GammaToLinear(bgra3.G), + 0); dst[dstIdx + 2] = (ushort)LinearToGamma( GammaToLinear(bgra0.B) + GammaToLinear(bgra1.B) + GammaToLinear(bgra2.B) + - GammaToLinear(bgra3.B), 0); + GammaToLinear(bgra3.B), + 0); } if ((width & 1) != 0) @@ -178,23 +181,26 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossy Bgra32 bgra3 = nextRowSpan[j + 1]; uint a = (uint)(bgra0.A + bgra1.A + bgra2.A + bgra3.A); int r, g, b; - if (a == 4 * 0xff || a == 0) + if (a is 4 * 0xff or 0) { r = (ushort)LinearToGamma( GammaToLinear(bgra0.R) + GammaToLinear(bgra1.R) + GammaToLinear(bgra2.R) + - GammaToLinear(bgra3.R), 0); + GammaToLinear(bgra3.R), + 0); g = (ushort)LinearToGamma( GammaToLinear(bgra0.G) + GammaToLinear(bgra1.G) + GammaToLinear(bgra2.G) + - GammaToLinear(bgra3.G), 0); + GammaToLinear(bgra3.G), + 0); b = (ushort)LinearToGamma( GammaToLinear(bgra0.B) + GammaToLinear(bgra1.B) + GammaToLinear(bgra2.B) + - GammaToLinear(bgra3.B), 0); + GammaToLinear(bgra3.B), + 0); } else { @@ -215,7 +221,7 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossy bgra1 = nextRowSpan[j]; uint a = (uint)(2u * (bgra0.A + bgra1.A)); int r, g, b; - if (a == 4 * 0xff || a == 0) + if (a is 4 * 0xff or 0) { r = (ushort)LinearToGamma(GammaToLinear(bgra0.R) + GammaToLinear(bgra1.R), 1); g = (ushort)LinearToGamma(GammaToLinear(bgra0.G) + GammaToLinear(bgra1.G), 1); diff --git a/src/ImageSharp/Formats/WebP/WebpDecoder.cs b/src/ImageSharp/Formats/WebP/WebpDecoder.cs index 84c758c783..b4e6cecd0c 100644 --- a/src/ImageSharp/Formats/WebP/WebpDecoder.cs +++ b/src/ImageSharp/Formats/WebP/WebpDecoder.cs @@ -4,7 +4,6 @@ using System.IO; using System.Threading; using System.Threading.Tasks; - using SixLabors.ImageSharp.IO; using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.PixelFormats; diff --git a/src/ImageSharp/Formats/WebP/WebpLookupTables.cs b/src/ImageSharp/Formats/WebP/WebpLookupTables.cs index 462b65aa68..54ae5661e7 100644 --- a/src/ImageSharp/Formats/WebP/WebpLookupTables.cs +++ b/src/ImageSharp/Formats/WebP/WebpLookupTables.cs @@ -974,7 +974,7 @@ namespace SixLabors.ImageSharp.Formats.Webp } }; - public static readonly (int code, int extraBits)[] PrefixEncodeCode = new (int code, int extraBits)[] + public static readonly (int Code, int ExtraBits)[] PrefixEncodeCode = { (0, 0), (0, 0), (1, 0), (2, 0), (3, 0), (4, 1), (4, 1), (5, 1), (5, 1), (6, 2), (6, 2), (6, 2), (6, 2), (7, 2), (7, 2), (7, 2), diff --git a/tests/ImageSharp.Tests/Formats/WebP/WebpDecoderTests.cs b/tests/ImageSharp.Tests/Formats/WebP/WebpDecoderTests.cs index 262e1724b3..7d763c05a7 100644 --- a/tests/ImageSharp.Tests/Formats/WebP/WebpDecoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/WebP/WebpDecoderTests.cs @@ -2,13 +2,10 @@ // Licensed under the Apache License, Version 2.0. using System.IO; - using SixLabors.ImageSharp.Formats.Webp; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Tests.TestUtilities.ReferenceCodecs; - using Xunit; - using static SixLabors.ImageSharp.Tests.TestImages.WebP; // ReSharper disable InconsistentNaming @@ -18,9 +15,9 @@ namespace SixLabors.ImageSharp.Tests.Formats.Webp [Trait("Format", "Webp")] public class WebpDecoderTests { - private static WebpDecoder WebpDecoder => new WebpDecoder(); + private static WebpDecoder WebpDecoder => new(); - private static MagickReferenceDecoder ReferenceDecoder => new MagickReferenceDecoder(); + private static MagickReferenceDecoder ReferenceDecoder => new(); [Theory] [InlineData(Lossless.GreenTransform1, 1000, 307, 32)]