Browse Source

762: added AoT method to pre-seed dithering engine

af/merge-core
Dan Manning 7 years ago
parent
commit
83eeca9246
  1. 14
      src/ImageSharp/Formats/Gif/ImageExtensions.cs

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

@ -5,6 +5,8 @@ using System.IO;
using SixLabors.ImageSharp.Advanced;
using SixLabors.ImageSharp.Formats.Gif;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Primitives;
using SixLabors.ImageSharp.Processing.Processors.Dithering;
using SixLabors.ImageSharp.Processing.Processors.Quantization;
namespace SixLabors.ImageSharp
@ -54,5 +56,17 @@ namespace SixLabors.ImageSharp
var test = new OctreeFrameQuantizer<TPixel>(new OctreeQuantizer(false));
test.AotGetPalette();
}
/// <summary>
/// This method pre-seeds the default FloydSteinbergDiffuser in the AoT compiler for iOS.
/// </summary>
/// <typeparam name="TPixel">The pixel format.</typeparam>
public static void AotCompileDithering<TPixel>()
where TPixel : struct, IPixel<TPixel>
{
var test = new FloydSteinbergDiffuser();
TPixel pixel = default;
test.Dither<TPixel>(new ImageFrame<TPixel>(Configuration.Default, 1, 1), pixel, pixel, 0, 0, 0, 0, 0, 0);
}
}
}

Loading…
Cancel
Save