Browse Source

762: added AoT method to pre-seed WuQuantizer

pull/767/head
Dan Manning 7 years ago
parent
commit
78070dcc89
  1. 14
      src/ImageSharp/Formats/Gif/ImageExtensions.cs
  2. 2
      src/ImageSharp/Processing/Processors/Quantization/WuFrameQuantizer{TPixel}.cs

14
src/ImageSharp/Formats/Gif/ImageExtensions.cs

@ -58,7 +58,19 @@ namespace SixLabors.ImageSharp
}
/// <summary>
/// This method pre-seeds the default FloydSteinbergDiffuser in the AoT compiler for iOS.
/// This method pre-seeds the WuQuantizer in the AoT compiler for iOS.
/// </summary>
/// <typeparam name="TPixel">The pixel format.</typeparam>
public static void AotCompileWuQuantizer<TPixel>()
where TPixel : struct, IPixel<TPixel>
{
var test = new WuFrameQuantizer<TPixel>(new WuQuantizer(false));
test.QuantizeFrame(new ImageFrame<TPixel>(Configuration.Default, 1, 1));
test.AotGetPalette();
}
/// <summary>
/// This method pre-seeds the default dithering engine (FloydSteinbergDiffuser) in the AoT compiler for iOS.
/// </summary>
/// <typeparam name="TPixel">The pixel format.</typeparam>
public static void AotCompileDithering<TPixel>()

2
src/ImageSharp/Processing/Processors/Quantization/WuFrameQuantizer{TPixel}.cs

@ -173,6 +173,8 @@ namespace SixLabors.ImageSharp.Processing.Processors.Quantization
}
}
internal TPixel[] AotGetPalette() => this.GetPalette();
/// <inheritdoc/>
protected override TPixel[] GetPalette()
{

Loading…
Cancel
Save