Browse Source

Removed unused argument.

pull/2189/head
Dirk Lemstra 4 years ago
parent
commit
f9c9a019d1
No known key found for this signature in database GPG Key ID: 40B84DE7D6271D30
  1. 2
      src/ImageSharp/Configuration.cs
  2. 4
      src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConverter{TPixel}.cs
  3. 2
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Rgb24.PixelOperations.cs
  4. 2
      src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Rgba32.PixelOperations.cs
  5. 4
      src/ImageSharp/PixelFormats/PixelOperations{TPixel}.cs
  6. 2
      tests/ImageSharp.Tests/PixelFormats/PixelOperations/PixelOperationsTests.cs

2
src/ImageSharp/Configuration.cs

@ -70,7 +70,7 @@ namespace SixLabors.ImageSharp
get => this.maxDegreeOfParallelism;
set
{
if (value == 0 || value < -1)
if (value is 0 or < -1)
{
throw new ArgumentOutOfRangeException(nameof(this.MaxDegreeOfParallelism));
}

4
src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConverter{TPixel}.cs

@ -155,12 +155,12 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder
// pack pixels to a temporary, padded proxy buffer, then copy the relevant values to the destination row.
if (this.pixelBuffer.DangerousTryGetPaddedRowSpan(yy, 3, out Span<TPixel> destRow))
{
PixelOperations<TPixel>.Instance.PackFromRgbPlanes(this.configuration, r, g, b, destRow);
PixelOperations<TPixel>.Instance.PackFromRgbPlanes(r, g, b, destRow);
}
else
{
Span<TPixel> proxyRow = this.paddedProxyPixelRow.GetSpan();
PixelOperations<TPixel>.Instance.PackFromRgbPlanes(this.configuration, r, g, b, proxyRow);
PixelOperations<TPixel>.Instance.PackFromRgbPlanes(r, g, b, proxyRow);
proxyRow[..width].CopyTo(this.pixelBuffer.DangerousGetRowSpan(yy));
}
}

2
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Rgb24.PixelOperations.cs

@ -24,13 +24,11 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <inheritdoc />
internal override void PackFromRgbPlanes(
Configuration configuration,
ReadOnlySpan<byte> redChannel,
ReadOnlySpan<byte> greenChannel,
ReadOnlySpan<byte> blueChannel,
Span<Rgb24> destination)
{
Guard.NotNull(configuration, nameof(configuration));
int count = redChannel.Length;
GuardPackFromRgbPlanes(greenChannel, blueChannel, destination, count);

2
src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/Rgba32.PixelOperations.cs

@ -59,13 +59,11 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <inheritdoc />
internal override void PackFromRgbPlanes(
Configuration configuration,
ReadOnlySpan<byte> redChannel,
ReadOnlySpan<byte> greenChannel,
ReadOnlySpan<byte> blueChannel,
Span<Rgba32> destination)
{
Guard.NotNull(configuration, nameof(configuration));
int count = redChannel.Length;
GuardPackFromRgbPlanes(greenChannel, blueChannel, destination, count);

4
src/ImageSharp/PixelFormats/PixelOperations{TPixel}.cs

@ -166,20 +166,16 @@ namespace SixLabors.ImageSharp.PixelFormats
/// Bulk operation that packs 3 seperate RGB channels to <paramref name="destination"/>.
/// The destination must have a padding of 3.
/// </summary>
/// <param name="configuration">A <see cref="Configuration"/> to configure internal operations.</param>
/// <param name="redChannel">A <see cref="ReadOnlySpan{T}"/> to the red values.</param>
/// <param name="greenChannel">A <see cref="ReadOnlySpan{T}"/> to the green values.</param>
/// <param name="blueChannel">A <see cref="ReadOnlySpan{T}"/> to the blue values.</param>
/// <param name="destination">A <see cref="Span{T}"/> to the destination pixels.</param>
internal virtual void PackFromRgbPlanes(
Configuration configuration,
ReadOnlySpan<byte> redChannel,
ReadOnlySpan<byte> greenChannel,
ReadOnlySpan<byte> blueChannel,
Span<TPixel> destination)
{
Guard.NotNull(configuration, nameof(configuration));
int count = redChannel.Length;
GuardPackFromRgbPlanes(greenChannel, blueChannel, destination, count);

2
tests/ImageSharp.Tests/PixelFormats/PixelOperations/PixelOperationsTests.cs

@ -1057,7 +1057,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
public void PackFromRgbPlanes(int count)
=> SimdUtilsTests.TestPackFromRgbPlanes<TPixel>(
count,
(r, g, b, actual) => PixelOperations<TPixel>.Instance.PackFromRgbPlanes(this.Configuration, r, g, b, actual));
(r, g, b, actual) => PixelOperations<TPixel>.Instance.PackFromRgbPlanes(r, g, b, actual));
public delegate void RefAction<T1>(ref T1 arg1);

Loading…
Cancel
Save