From d9596ef33b213fd65210e2c6789be3d61188d2c0 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Wed, 4 Mar 2020 00:25:22 +1100 Subject: [PATCH] Cleanup and update references. --- .../Processors/Quantization/EuclideanPixelMap{TPixel}.cs | 4 +--- .../Processors/Quantization/FrameQuantizerExtensions.cs | 1 - .../Processors/Quantization/PaletteFrameQuantizer{TPixel}.cs | 3 --- .../Processing/Processors/Quantization/PaletteQuantizer.cs | 2 ++ tests/Images/External | 2 +- 5 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/ImageSharp/Processing/Processors/Quantization/EuclideanPixelMap{TPixel}.cs b/src/ImageSharp/Processing/Processors/Quantization/EuclideanPixelMap{TPixel}.cs index 6c23ba356..84a204bba 100644 --- a/src/ImageSharp/Processing/Processors/Quantization/EuclideanPixelMap{TPixel}.cs +++ b/src/ImageSharp/Processing/Processors/Quantization/EuclideanPixelMap{TPixel}.cs @@ -2,12 +2,10 @@ // Licensed under the Apache License, Version 2.0. using System; -using System.Buffers; using System.Collections.Concurrent; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.PixelFormats; namespace SixLabors.ImageSharp.Processing.Processors.Quantization @@ -106,5 +104,5 @@ namespace SixLabors.ImageSharp.Processing.Processors.Quantization match = Unsafe.Add(ref paletteRef, index); return index; } - } + } } diff --git a/src/ImageSharp/Processing/Processors/Quantization/FrameQuantizerExtensions.cs b/src/ImageSharp/Processing/Processors/Quantization/FrameQuantizerExtensions.cs index f695a705e..139ed6e9e 100644 --- a/src/ImageSharp/Processing/Processors/Quantization/FrameQuantizerExtensions.cs +++ b/src/ImageSharp/Processing/Processors/Quantization/FrameQuantizerExtensions.cs @@ -3,7 +3,6 @@ using System; using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.PixelFormats; diff --git a/src/ImageSharp/Processing/Processors/Quantization/PaletteFrameQuantizer{TPixel}.cs b/src/ImageSharp/Processing/Processors/Quantization/PaletteFrameQuantizer{TPixel}.cs index 11570beef..a9a938562 100644 --- a/src/ImageSharp/Processing/Processors/Quantization/PaletteFrameQuantizer{TPixel}.cs +++ b/src/ImageSharp/Processing/Processors/Quantization/PaletteFrameQuantizer{TPixel}.cs @@ -2,10 +2,7 @@ // Licensed under the Apache License, Version 2.0. using System; -using System.Buffers; using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.PixelFormats; namespace SixLabors.ImageSharp.Processing.Processors.Quantization diff --git a/src/ImageSharp/Processing/Processors/Quantization/PaletteQuantizer.cs b/src/ImageSharp/Processing/Processors/Quantization/PaletteQuantizer.cs index 7bae8787b..e856c389c 100644 --- a/src/ImageSharp/Processing/Processors/Quantization/PaletteQuantizer.cs +++ b/src/ImageSharp/Processing/Processors/Quantization/PaletteQuantizer.cs @@ -56,7 +56,9 @@ namespace SixLabors.ImageSharp.Processing.Processors.Quantization // multi frame gifs using a global palette. int length = Math.Min(this.colorPalette.Length, options.MaxColors); var palette = new TPixel[length]; + Color.ToPixel(configuration, this.colorPalette.Span, palette.AsSpan()); + var pixelMap = new EuclideanPixelMap(configuration, palette, length); return new PaletteFrameQuantizer(configuration, options, pixelMap); } diff --git a/tests/Images/External b/tests/Images/External index f8a76fd3a..1fea1ceab 160000 --- a/tests/Images/External +++ b/tests/Images/External @@ -1 +1 @@ -Subproject commit f8a76fd3a900b90c98df67ac896574383a4d09f3 +Subproject commit 1fea1ceab89e87cc5f11376fa46164d3d27566c0