Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V4 : Rewrite ChunkedMemoryStream #2838

Merged
merged 18 commits into from
Nov 13, 2024
Merged
Changes from 12 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ImageSharp/Formats/ImageEncoder.cs
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ private void EncodeWithSeekableStream<TPixel>(Image<TPixel> image, Stream stream
else
{
using ChunkedMemoryStream ms = new(configuration.MemoryAllocator);
this.Encode(image, stream, cancellationToken);
this.Encode(image, ms, cancellationToken);
ms.Position = 0;
ms.CopyTo(stream, configuration.StreamProcessingBufferSize);
}
@@ -65,7 +65,7 @@ private async Task EncodeWithSeekableStreamAsync<TPixel>(Image<TPixel> image, St
}
else
{
using ChunkedMemoryStream ms = new(configuration.MemoryAllocator);
await using ChunkedMemoryStream ms = new(configuration.MemoryAllocator);
await DoEncodeAsync(ms);
ms.Position = 0;
await ms.CopyToAsync(stream, configuration.StreamProcessingBufferSize, cancellationToken)
626 changes: 254 additions & 372 deletions src/ImageSharp/IO/ChunkedMemoryStream.cs

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions tests/ImageSharp.Tests/Formats/WebP/WebpEncoderTests.cs
Original file line number Diff line number Diff line change
@@ -544,6 +544,44 @@ public static void RunEncodeLossy_WithPeakImage()
[Fact]
public void RunEncodeLossy_WithPeakImage_WithoutHardwareIntrinsics_Works() => FeatureTestRunner.RunWithHwIntrinsicsFeature(RunEncodeLossy_WithPeakImage, HwIntrinsics.DisableHWIntrinsic);

[Theory]
[WithFile(TestPatternOpaque, PixelTypes.Rgba32)]
public void CanSave_NonSeekableStream<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
using Image<TPixel> image = provider.GetImage();
WebpEncoder encoder = new();

using MemoryStream seekable = new();
image.Save(seekable, encoder);

using MemoryStream memoryStream = new();
using NonSeekableStream nonSeekable = new(memoryStream);

image.Save(nonSeekable, encoder);

Assert.True(seekable.ToArray().SequenceEqual(memoryStream.ToArray()));
}

[Theory]
[WithFile(TestPatternOpaque, PixelTypes.Rgba32)]
public async Task CanSave_NonSeekableStream_Async<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
using Image<TPixel> image = provider.GetImage();
WebpEncoder encoder = new();

await using MemoryStream seekable = new();
image.Save(seekable, encoder);

await using MemoryStream memoryStream = new();
await using NonSeekableStream nonSeekable = new(memoryStream);

await image.SaveAsync(nonSeekable, encoder);

Assert.True(seekable.ToArray().SequenceEqual(memoryStream.ToArray()));
}

private static ImageComparer GetComparer(int quality)
{
float tolerance = 0.01f; // ~1.0%
163 changes: 108 additions & 55 deletions tests/ImageSharp.Tests/IO/ChunkedMemoryStreamTests.cs
Original file line number Diff line number Diff line change
@@ -13,6 +13,8 @@ namespace SixLabors.ImageSharp.Tests.IO;
/// </summary>
public class ChunkedMemoryStreamTests
{
private readonly Random bufferFiller = new(123);

/// <summary>
/// The default length in bytes of each buffer chunk when allocating large buffers.
/// </summary>
@@ -30,7 +32,7 @@ public class ChunkedMemoryStreamTests
[Fact]
public void MemoryStream_GetPositionTest_Negative()
{
using var ms = new ChunkedMemoryStream(this.allocator);
using ChunkedMemoryStream ms = new(this.allocator);
long iCurrentPos = ms.Position;
for (int i = -1; i > -6; i--)
{
@@ -42,7 +44,7 @@ public void MemoryStream_GetPositionTest_Negative()
[Fact]
public void MemoryStream_ReadTest_Negative()
{
var ms2 = new ChunkedMemoryStream(this.allocator);
ChunkedMemoryStream ms2 = new(this.allocator);

Assert.Throws<ArgumentNullException>(() => ms2.Read(null, 0, 0));
Assert.Throws<ArgumentOutOfRangeException>(() => ms2.Read(new byte[] { 1 }, -1, 0));
@@ -64,7 +66,7 @@ public void MemoryStream_ReadTest_Negative()
public void MemoryStream_ReadByteTest(int length)
{
using MemoryStream ms = this.CreateTestStream(length);
using var cms = new ChunkedMemoryStream(this.allocator);
using ChunkedMemoryStream cms = new(this.allocator);

ms.CopyTo(cms);
cms.Position = 0;
@@ -85,7 +87,7 @@ public void MemoryStream_ReadByteTest(int length)
public void MemoryStream_ReadByteBufferTest(int length)
{
using MemoryStream ms = this.CreateTestStream(length);
using var cms = new ChunkedMemoryStream(this.allocator);
using ChunkedMemoryStream cms = new(this.allocator);

ms.CopyTo(cms);
cms.Position = 0;
@@ -105,10 +107,11 @@ public void MemoryStream_ReadByteBufferTest(int length)
[InlineData(DefaultSmallChunkSize * 4)]
[InlineData((int)(DefaultSmallChunkSize * 5.5))]
[InlineData(DefaultSmallChunkSize * 16)]
[InlineData(DefaultSmallChunkSize * 32)]
public void MemoryStream_ReadByteBufferSpanTest(int length)
{
using MemoryStream ms = this.CreateTestStream(length);
using var cms = new ChunkedMemoryStream(this.allocator);
using ChunkedMemoryStream cms = new(this.allocator);

ms.CopyTo(cms);
cms.Position = 0;
@@ -122,18 +125,24 @@ public void MemoryStream_ReadByteBufferSpanTest(int length)
}
}

[Fact]
public void MemoryStream_WriteToTests()
[Theory]
[InlineData(DefaultSmallChunkSize)]
[InlineData((int)(DefaultSmallChunkSize * 1.5))]
[InlineData(DefaultSmallChunkSize * 4)]
[InlineData((int)(DefaultSmallChunkSize * 5.5))]
[InlineData(DefaultSmallChunkSize * 16)]
[InlineData(DefaultSmallChunkSize * 32)]
public void MemoryStream_WriteToTests(int length)
{
using (var ms2 = new ChunkedMemoryStream(this.allocator))
using (ChunkedMemoryStream ms2 = new(this.allocator))
{
byte[] bytArrRet;
byte[] bytArr = new byte[] { byte.MinValue, byte.MaxValue, 1, 2, 3, 4, 5, 6, 128, 250 };
byte[] bytArr = this.CreateTestBuffer(length);

// [] Write to memoryStream, check the memoryStream
ms2.Write(bytArr, 0, bytArr.Length);

using var readonlyStream = new ChunkedMemoryStream(this.allocator);
using ChunkedMemoryStream readonlyStream = new(this.allocator);
ms2.WriteTo(readonlyStream);
readonlyStream.Flush();
readonlyStream.Position = 0;
@@ -146,11 +155,11 @@ public void MemoryStream_WriteToTests()
}

// [] Write to memoryStream, check the memoryStream
using (var ms2 = new ChunkedMemoryStream(this.allocator))
using (var ms3 = new ChunkedMemoryStream(this.allocator))
using (ChunkedMemoryStream ms2 = new(this.allocator))
using (ChunkedMemoryStream ms3 = new(this.allocator))
{
byte[] bytArrRet;
byte[] bytArr = new byte[] { byte.MinValue, byte.MaxValue, 1, 2, 3, 4, 5, 6, 128, 250 };
byte[] bytArr = this.CreateTestBuffer(length);

ms2.Write(bytArr, 0, bytArr.Length);
ms2.WriteTo(ms3);
@@ -164,21 +173,29 @@ public void MemoryStream_WriteToTests()
}
}

[Fact]
public void MemoryStream_WriteToSpanTests()
[Theory]
[InlineData(DefaultSmallChunkSize)]
[InlineData((int)(DefaultSmallChunkSize * 1.5))]
[InlineData(DefaultSmallChunkSize * 4)]
[InlineData((int)(DefaultSmallChunkSize * 5.5))]
[InlineData(DefaultSmallChunkSize * 16)]
[InlineData(DefaultSmallChunkSize * 32)]
public void MemoryStream_WriteToSpanTests(int length)
{
using (var ms2 = new ChunkedMemoryStream(this.allocator))
using (ChunkedMemoryStream ms2 = new(this.allocator))
{
Span<byte> bytArrRet;
Span<byte> bytArr = new byte[] { byte.MinValue, byte.MaxValue, 1, 2, 3, 4, 5, 6, 128, 250 };
Span<byte> bytArr = this.CreateTestBuffer(length);

// [] Write to memoryStream, check the memoryStream
ms2.Write(bytArr, 0, bytArr.Length);

using var readonlyStream = new ChunkedMemoryStream(this.allocator);
using ChunkedMemoryStream readonlyStream = new(this.allocator);
ms2.WriteTo(readonlyStream);

readonlyStream.Flush();
readonlyStream.Position = 0;

bytArrRet = new byte[(int)readonlyStream.Length];
readonlyStream.Read(bytArrRet, 0, (int)readonlyStream.Length);
for (int i = 0; i < bytArr.Length; i++)
@@ -188,13 +205,14 @@ public void MemoryStream_WriteToSpanTests()
}

// [] Write to memoryStream, check the memoryStream
using (var ms2 = new ChunkedMemoryStream(this.allocator))
using (var ms3 = new ChunkedMemoryStream(this.allocator))
using (ChunkedMemoryStream ms2 = new(this.allocator))
using (ChunkedMemoryStream ms3 = new(this.allocator))
{
Span<byte> bytArrRet;
Span<byte> bytArr = new byte[] { byte.MinValue, byte.MaxValue, 1, 2, 3, 4, 5, 6, 128, 250 };
Span<byte> bytArr = this.CreateTestBuffer(length);

ms2.Write(bytArr, 0, bytArr.Length);

ms2.WriteTo(ms3);
ms3.Position = 0;
bytArrRet = new byte[(int)ms3.Length];
@@ -209,37 +227,35 @@ public void MemoryStream_WriteToSpanTests()
[Fact]
public void MemoryStream_WriteByteTests()
{
using (var ms2 = new ChunkedMemoryStream(this.allocator))
{
byte[] bytArrRet;
byte[] bytArr = new byte[] { byte.MinValue, byte.MaxValue, 1, 2, 3, 4, 5, 6, 128, 250 };
using ChunkedMemoryStream ms2 = new(this.allocator);
byte[] bytArrRet;
byte[] bytArr = new byte[] { byte.MinValue, byte.MaxValue, 1, 2, 3, 4, 5, 6, 128, 250 };

for (int i = 0; i < bytArr.Length; i++)
{
ms2.WriteByte(bytArr[i]);
}
for (int i = 0; i < bytArr.Length; i++)
{
ms2.WriteByte(bytArr[i]);
}

using var readonlyStream = new ChunkedMemoryStream(this.allocator);
ms2.WriteTo(readonlyStream);
readonlyStream.Flush();
readonlyStream.Position = 0;
bytArrRet = new byte[(int)readonlyStream.Length];
readonlyStream.Read(bytArrRet, 0, (int)readonlyStream.Length);
for (int i = 0; i < bytArr.Length; i++)
{
Assert.Equal(bytArr[i], bytArrRet[i]);
}
using ChunkedMemoryStream readonlyStream = new(this.allocator);
ms2.WriteTo(readonlyStream);
readonlyStream.Flush();
readonlyStream.Position = 0;
bytArrRet = new byte[(int)readonlyStream.Length];
readonlyStream.Read(bytArrRet, 0, (int)readonlyStream.Length);
for (int i = 0; i < bytArr.Length; i++)
{
Assert.Equal(bytArr[i], bytArrRet[i]);
}
}

[Fact]
public void MemoryStream_WriteToTests_Negative()
{
using var ms2 = new ChunkedMemoryStream(this.allocator);
using ChunkedMemoryStream ms2 = new(this.allocator);
Assert.Throws<ArgumentNullException>(() => ms2.WriteTo(null));

ms2.Write(new byte[] { 1 }, 0, 1);
var readonlyStream = new MemoryStream(new byte[1028], false);
MemoryStream readonlyStream = new(new byte[1028], false);
Assert.Throws<NotSupportedException>(() => ms2.WriteTo(readonlyStream));

readonlyStream.Dispose();
@@ -286,7 +302,7 @@ public void MemoryStream_CopyTo_Invalid()
[MemberData(nameof(CopyToData))]
public void CopyTo(Stream source, byte[] expected)
{
using var destination = new ChunkedMemoryStream(this.allocator);
using ChunkedMemoryStream destination = new(this.allocator);
source.CopyTo(destination);
Assert.InRange(source.Position, source.Length, int.MaxValue); // Copying the data should have read to the end of the stream or stayed past the end.
Assert.Equal(expected, destination.ToArray());
@@ -297,16 +313,16 @@ public static IEnumerable<string> GetAllTestImages()
IEnumerable<string> allImageFiles = Directory.EnumerateFiles(TestEnvironment.InputImagesDirectoryFullPath, "*.*", SearchOption.AllDirectories)
.Where(s => !s.EndsWith("txt", StringComparison.OrdinalIgnoreCase));

var result = new List<string>();
List<string> result = new();
foreach (string path in allImageFiles)
{
result.Add(path.Substring(TestEnvironment.InputImagesDirectoryFullPath.Length));
result.Add(path[TestEnvironment.InputImagesDirectoryFullPath.Length..]);
}

return result;
}

public static IEnumerable<string> AllTestImages = GetAllTestImages();
public static IEnumerable<string> AllTestImages { get; } = GetAllTestImages();

[Theory]
[WithFileCollection(nameof(AllTestImages), PixelTypes.Rgba32)]
@@ -334,40 +350,77 @@ public void DecoderIntegrationTest<TPixel>(TestImageProvider<TPixel> provider)
((TestImageProvider<TPixel>.FileProvider)provider).FilePath);

using FileStream fs = File.OpenRead(fullPath);
using var nonSeekableStream = new NonSeekableStream(fs);
using NonSeekableStream nonSeekableStream = new(fs);

using Image<TPixel> actual = Image.Load<TPixel>(nonSeekableStream);

ImageComparer.Exact.VerifySimilarity(expected, actual);
expected.Dispose();
}

[Theory]
[WithFileCollection(nameof(AllTestImages), PixelTypes.Rgba32)]
public void EncoderIntegrationTest<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
if (!TestEnvironment.Is64BitProcess)
{
return;
}

Image<TPixel> expected;
try
{
expected = provider.GetImage();
}
catch
{
// The image is invalid
return;
}

var actual = Image.Load<TPixel>(nonSeekableStream);
string fullPath = Path.Combine(
TestEnvironment.InputImagesDirectoryFullPath,
((TestImageProvider<TPixel>.FileProvider)provider).FilePath);

using MemoryStream ms = new();
using NonSeekableStream nonSeekableStream = new(ms);
expected.SaveAsWebp(nonSeekableStream);

using Image<TPixel> actual = Image.Load<TPixel>(nonSeekableStream);

ImageComparer.Exact.VerifySimilarity(expected, actual);
expected.Dispose();
}

public static IEnumerable<object[]> CopyToData()
{
// Stream is positioned @ beginning of data
byte[] data1 = new byte[] { 1, 2, 3 };
var stream1 = new MemoryStream(data1);
MemoryStream stream1 = new(data1);

yield return new object[] { stream1, data1 };

// Stream is positioned in the middle of data
byte[] data2 = new byte[] { 0xff, 0xf3, 0xf0 };
var stream2 = new MemoryStream(data2) { Position = 1 };
MemoryStream stream2 = new(data2) { Position = 1 };

yield return new object[] { stream2, new byte[] { 0xf3, 0xf0 } };

// Stream is positioned after end of data
byte[] data3 = data2;
var stream3 = new MemoryStream(data3) { Position = data3.Length + 1 };
MemoryStream stream3 = new(data3) { Position = data3.Length + 1 };

yield return new object[] { stream3, Array.Empty<byte>() };
}

private MemoryStream CreateTestStream(int length)
private byte[] CreateTestBuffer(int length)
{
byte[] buffer = new byte[length];
var random = new Random();
random.NextBytes(buffer);

return new MemoryStream(buffer);
this.bufferFiller.NextBytes(buffer);
return buffer;
}

private MemoryStream CreateTestStream(int length)
=> new(this.CreateTestBuffer(length));
}
6 changes: 3 additions & 3 deletions tests/ImageSharp.Tests/Image/NonSeekableStream.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Six Labors.
// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.

namespace SixLabors.ImageSharp.Tests;
@@ -14,7 +14,7 @@ public NonSeekableStream(Stream dataStream)

public override bool CanSeek => false;

public override bool CanWrite => false;
public override bool CanWrite => this.dataStream.CanWrite;

public override bool CanTimeout => this.dataStream.CanTimeout;

@@ -91,5 +91,5 @@ public override void SetLength(long value)
=> throw new NotSupportedException();

public override void Write(byte[] buffer, int offset, int count)
=> throw new NotImplementedException();
=> this.dataStream.Write(buffer, offset, count);
}

Unchanged files with check annotations Beta

public abstract class FromVector4<TPixel>
where TPixel : unmanaged, IPixel<TPixel>
{
protected IMemoryOwner<Vector4> source;

Check warning on line 21 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, ubuntu-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 21 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, ubuntu-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 21 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, macos-13, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 21 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, windows-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 21 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, macos-13, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 21 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, windows-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 21 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, ubuntu-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 21 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, ubuntu-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 21 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, windows-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 21 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, windows-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 21 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, macos-13, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 21 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, macos-13, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)
protected IMemoryOwner<TPixel> destination;

Check warning on line 23 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, ubuntu-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 23 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, ubuntu-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 23 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, macos-13, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 23 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, windows-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 23 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, macos-13, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 23 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, windows-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 23 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, ubuntu-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 23 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, ubuntu-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 23 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, windows-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 23 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, windows-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 23 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, macos-13, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 23 in tests/ImageSharp.Benchmarks/Bulk/FromVector4.cs

GitHub Actions / Build (false, macos-13, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)
protected Configuration Configuration => Configuration.Default;
public abstract class ToVector4<TPixel>
where TPixel : unmanaged, IPixel<TPixel>
{
protected IMemoryOwner<TPixel> source;

Check warning on line 17 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, ubuntu-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 17 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, ubuntu-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 17 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, macos-13, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 17 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, windows-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 17 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, macos-13, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 17 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, windows-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 17 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, ubuntu-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 17 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, ubuntu-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 17 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, windows-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 17 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, windows-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 17 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, macos-13, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 17 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, macos-13, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)
protected IMemoryOwner<Vector4> destination;

Check warning on line 19 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, ubuntu-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 19 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, ubuntu-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 19 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, macos-13, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 19 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, windows-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 19 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, macos-13, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 19 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, windows-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 19 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, ubuntu-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 19 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, ubuntu-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 19 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, windows-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 19 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, windows-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 19 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, macos-13, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 19 in tests/ImageSharp.Benchmarks/Bulk/ToVector4.cs

GitHub Actions / Build (false, macos-13, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)
protected Configuration Configuration => Configuration.Default;
public abstract class SIMDBenchmarkBase<T>
where T : struct
{
protected T[] input;

Check warning on line 13 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, ubuntu-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 13 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, ubuntu-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 13 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, macos-13, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 13 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, windows-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 13 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, macos-13, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 13 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, windows-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 13 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, ubuntu-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 13 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, ubuntu-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 13 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, windows-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 13 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, windows-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 13 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, macos-13, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 13 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, macos-13, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)
protected T[] result;

Check warning on line 15 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, ubuntu-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 15 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, ubuntu-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 15 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, macos-13, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 15 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, windows-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 15 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, macos-13, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 15 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, windows-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 15 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, ubuntu-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 15 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, ubuntu-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 15 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, windows-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 15 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, windows-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 15 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, macos-13, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 15 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, macos-13, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)
protected T testValue;

Check warning on line 17 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, ubuntu-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 17 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, ubuntu-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 17 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, macos-13, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 17 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, windows-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 17 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, macos-13, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 17 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, windows-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 17 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, ubuntu-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 17 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, ubuntu-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 17 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, windows-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 17 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, windows-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 17 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, macos-13, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 17 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, macos-13, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)
protected Vector<T> testVector;

Check warning on line 19 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, ubuntu-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 19 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, ubuntu-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 19 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, macos-13, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 19 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, windows-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 19 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, macos-13, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 19 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, windows-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 19 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, ubuntu-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 19 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, ubuntu-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 19 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, windows-latest, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 19 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, windows-latest, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 19 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, macos-13, net6.0, 6.0.x, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)

Check warning on line 19 in tests/ImageSharp.Benchmarks/General/Vectorization/SIMDBenchmarkBase.cs

GitHub Actions / Build (false, macos-13, net7.0, 7.0.x, true, -x64, false)

Do not declare visible instance fields (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1051)
protected virtual T GetTestValue() => default;
{
private Block8x8 source;
private Block8x8F dest = default;

Check warning on line 16 in tests/ImageSharp.Benchmarks/Codecs/Jpeg/BlockOperations/Block8x8F_LoadFromInt16.cs

GitHub Actions / Build (false, ubuntu-latest, net7.0, 7.0.x, true, -x64, false)

Member 'dest' is explicitly initialized to its default value (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1805)

Check warning on line 16 in tests/ImageSharp.Benchmarks/Codecs/Jpeg/BlockOperations/Block8x8F_LoadFromInt16.cs

GitHub Actions / Build (false, windows-latest, net7.0, 7.0.x, true, -x64, false)

Member 'dest' is explicitly initialized to its default value (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1805)

Check warning on line 16 in tests/ImageSharp.Benchmarks/Codecs/Jpeg/BlockOperations/Block8x8F_LoadFromInt16.cs

GitHub Actions / Build (false, windows-latest, net6.0, 6.0.x, -x64, false)

Member 'dest' is explicitly initialized to its default value (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1805)

Check warning on line 16 in tests/ImageSharp.Benchmarks/Codecs/Jpeg/BlockOperations/Block8x8F_LoadFromInt16.cs

GitHub Actions / Build (false, macos-13, net6.0, 6.0.x, -x64, false)

Member 'dest' is explicitly initialized to its default value (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1805)
[GlobalSetup]
public void Setup()
public abstract class Resize<TPixel>
where TPixel : unmanaged, IPixel<TPixel>
{
private byte[] bytes = null;

Check warning on line 19 in tests/ImageSharp.Benchmarks/Processing/Resize.cs

GitHub Actions / Build (false, ubuntu-latest, net6.0, 6.0.x, -x64, false)

Member 'bytes' is explicitly initialized to its default value (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1805)

Check warning on line 19 in tests/ImageSharp.Benchmarks/Processing/Resize.cs

GitHub Actions / Build (false, macos-13, net6.0, 6.0.x, -x64, false)

Member 'bytes' is explicitly initialized to its default value (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1805)

Check warning on line 19 in tests/ImageSharp.Benchmarks/Processing/Resize.cs

GitHub Actions / Build (false, macos-13, net7.0, 7.0.x, true, -x64, false)

Member 'bytes' is explicitly initialized to its default value (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1805)

Check warning on line 19 in tests/ImageSharp.Benchmarks/Processing/Resize.cs

GitHub Actions / Build (false, ubuntu-latest, net7.0, 7.0.x, true, -x64, false)

Member 'bytes' is explicitly initialized to its default value (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1805)

Check warning on line 19 in tests/ImageSharp.Benchmarks/Processing/Resize.cs

GitHub Actions / Build (false, ubuntu-latest, net6.0, 6.0.x, -x64, false)

Member 'bytes' is explicitly initialized to its default value (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1805)

Check warning on line 19 in tests/ImageSharp.Benchmarks/Processing/Resize.cs

GitHub Actions / Build (false, macos-13, net7.0, 7.0.x, true, -x64, false)

Member 'bytes' is explicitly initialized to its default value (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1805)
private Image<TPixel> sourceImage;
// Set the quality for ImagSharp
private readonly JpegEncoder imageSharpJpegEncoder = new() { Quality = Quality };
private readonly ImageCodecInfo systemDrawingJpegCodec =
ImageCodecInfo.GetImageEncoders().First(codec => codec.FormatID == ImageFormat.Jpeg.Guid);

Check warning on line 36 in tests/ImageSharp.Benchmarks/LoadResizeSave/LoadResizeSaveStressRunner.cs

GitHub Actions / Build (false, windows-latest, net7.0, 7.0.x, true, -x64, false)

This call site is reachable on all platforms. 'ImageCodecInfo.GetImageEncoders()' is only supported on: 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)

Check warning on line 36 in tests/ImageSharp.Benchmarks/LoadResizeSave/LoadResizeSaveStressRunner.cs

GitHub Actions / Build (false, windows-latest, net6.0, 6.0.x, -x64, false)

This call site is reachable on all platforms. 'ImageFormat.Guid' is only supported on: 'windows'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1416)
public string[] Images { get; private set; }