diff --git a/src/ImageSharp/Advanced/AotCompilerTools.cs b/src/ImageSharp/Advanced/AotCompilerTools.cs index dc0c59e7bf..666eb513f1 100644 --- a/src/ImageSharp/Advanced/AotCompilerTools.cs +++ b/src/ImageSharp/Advanced/AotCompilerTools.cs @@ -82,6 +82,7 @@ namespace SixLabors.ImageSharp.Advanced where TPixel : unmanaged, IPixel { // This is we actually call all the individual methods you need to seed. + AotPixelInterface(); AotCompileOctreeQuantizer(); AotCompileWuQuantizer(); AotCompilePaletteQuantizer(); @@ -95,6 +96,30 @@ namespace SixLabors.ImageSharp.Advanced // TODO: Do the discovery work to figure out what works and what doesn't. } + private static void AotPixelInterface() + where TPixel : unmanaged, IPixel + { + TPixel pixel = default; + Rgba32 rgba32 = default; + pixel.ToRgba32(ref rgba32); + pixel.FromRgba32(rgba32); + pixel.FromScaledVector4(pixel.ToScaledVector4()); + pixel.FromVector4(pixel.ToVector4()); + + pixel.FromArgb32(default); + pixel.FromBgr24(default); + pixel.FromBgra32(default); + pixel.FromBgra5551(default); + pixel.FromL16(default); + pixel.FromL8(default); + pixel.FromLa16(default); + pixel.FromLa32(default); + pixel.FromRgb24(default); + pixel.FromRgb48(default); + pixel.FromRgba64(default); + pixel.FromRgb24(default); + } + /// /// This method doesn't actually do anything but serves an important purpose... /// If you are running ImageSharp on iOS and try to call SaveAsGif, it will throw an exception: @@ -107,7 +132,7 @@ namespace SixLabors.ImageSharp.Advanced /// /// The pixel format. private static void AotCompileOctreeQuantizer() - where TPixel : unmanaged, IPixel + where TPixel : unmanaged, IPixel { using var test = new OctreeQuantizer(Configuration.Default, new OctreeQuantizer().Options); var frame = new ImageFrame(Configuration.Default, 1, 1);