-[](https://github.com/SixLabors/ImageSharp/actions)
-[](https://codecov.io/gh/SixLabors/ImageSharp)
+[](https://github.com/SixLabors/ImageSharp/actions)
+[](https://codecov.io/gh/SixLabors/ImageSharp)
[](https://opensource.org/licenses/Apache-2.0)
[](https://twitter.com/intent/tweet?hashtags=imagesharp,dotnet,oss&text=ImageSharp.+A+new+cross-platform+2D+graphics+API+in+C%23&url=https%3a%2f%2fgithub.com%2fSixLabors%2fImageSharp&via=sixlabors)
@@ -20,24 +20,32 @@ ImageSharp is a new, fully featured, fully managed, cross-platform, 2D graphics
ImageSharp is designed from the ground up to be flexible and extensible. The library provides API endpoints for common image processing operations and the building blocks to allow for the development of additional operations.
-Built against [.NET Standard 1.3](https://docs.microsoft.com/en-us/dotnet/standard/net-standard), ImageSharp can be used in device, cloud, and embedded/IoT scenarios.
+Built against [.NET Standard 2.0](https://docs.microsoft.com/en-us/dotnet/standard/net-standard), ImageSharp can be used in device, cloud, and embedded/IoT scenarios.
## License
- ImageSharp is licensed under the [Apache License, Version 2.0](https://opensource.org/licenses/Apache-2.0)
-- An alternative Commercial License can be purchased for projects and applications requiring support.
+- An alternative Six Labors License can be purchased **for projects and applications requiring developer support**.
Please visit https://sixlabors.com/pricing for details.
+## Support Six Labors
+
+Support the efforts of the development of the Six Labors projects.
+ - [Purchase a Commercial Support License :heart:](https://sixlabors.com/pricing/)
+ - [Become a sponsor via GitHub Sponsors :heart:]( https://github.com/sponsors/SixLabors)
+ - [Become a sponsor via Open Collective :heart:](https://opencollective.com/sixlabors)
+
## Documentation
- [Detailed documentation](https://sixlabors.github.io/docs/) for the ImageSharp API is available. This includes additional conceptual documentation to help you get started.
-- Our [Samples Repository](https://github.com/SixLabors/Samples/tree/master/ImageSharp) is also available containing buildable code samples demonstrating common activities.
+- Our [Samples Repository](https://github.com/SixLabors/Samples/tree/main/ImageSharp) is also available containing buildable code samples demonstrating common activities.
## Questions
-- Do you have questions? We are happy to help! Please [join our Discussions Forum](https://github.com/SixLabors/ImageSharp/discussions/category_choices), or ask them on [Stack Overflow](https://stackoverflow.com) using the `ImageSharp` tag. Please do not open issues for questions.
-- Please read our [Contribution Guide](https://github.com/SixLabors/ImageSharp/blob/master/.github/CONTRIBUTING.md) before opening issues or pull requests!
+- Do you have questions? We are happy to help! Simply purchase a [Six Labors License](https://sixlabors.com/pricing) for developer support. Please do not open issues for questions or misuse our [Discussions Forum](https://github.com/SixLabors/ImageSharp/discussions).
+- For feature ideas please [join our Discussions Forum](https://github.com/SixLabors/ImageSharp/discussions/categories/ideas) and we'll be happy to discuss.
+- Please read our [Contribution Guide](https://github.com/SixLabors/ImageSharp/blob/main/.github/CONTRIBUTING.md) before opening issues or pull requests!
## Code of Conduct
This project has adopted the code of conduct defined by the [Contributor Covenant](https://contributor-covenant.org/) to clarify expected behavior in our community.
@@ -49,7 +57,7 @@ Install stable releases via Nuget; development releases are available via MyGet.
| Package Name | Release (NuGet) | Nightly (MyGet) |
|--------------------------------|-----------------|-----------------|
-| `SixLabors.ImageSharp` | [](https://www.nuget.org/packages/SixLabors.ImageSharp/) | [](https://www.myget.org/feed/sixlabors/package/nuget/SixLabors.ImageSharp) |
+| `SixLabors.ImageSharp` | [](https://www.nuget.org/packages/SixLabors.ImageSharp/) | [](https://www.myget.org/feed/sixlabors/package/nuget/SixLabors.ImageSharp) |
## Manual build
@@ -57,7 +65,7 @@ If you prefer, you can compile ImageSharp yourself (please do and help!)
- Using [Visual Studio 2019](https://visualstudio.microsoft.com/vs/)
- Make sure you have the latest version installed
- - Make sure you have [the .NET Core 3.1 SDK](https://www.microsoft.com/net/core#windows) installed
+ - Make sure you have [the .NET 5 SDK](https://www.microsoft.com/net/core#windows) installed
Alternatively, you can work from command line and/or with a lightweight editor on **both Linux/Unix and Windows**:
@@ -70,13 +78,15 @@ To clone ImageSharp locally, click the "Clone in [YOUR_OS]" button above or run
git clone https://github.com/SixLabors/ImageSharp
```
-If working with Windows please ensure that you have enabled log file paths in git (run as Administrator).
+If working with Windows please ensure that you have enabled long file paths in git (run as Administrator).
```bash
git config --system core.longpaths true
```
-This repository contains [git submodules](https://blog.github.com/2016-02-01-working-with-submodules/). To add the submodules to the project, navigate to the repository root and type:
+This repository uses [Git Large File Storage](https://docs.github.com/en/github/managing-large-files/installing-git-large-file-storage). Please follow the linked instructions to ensure you have it set up in your environment.
+
+This repository contains [Git Submodules](https://blog.github.com/2016-02-01-working-with-submodules/). To add the submodules to the project, navigate to the repository root and type:
``` bash
git submodule update --init --recursive
@@ -84,7 +94,7 @@ git submodule update --init --recursive
## How can you help?
-Please... Spread the word, contribute algorithms, submit performance improvements, unit tests, no input is too little. Make sure to read our [Contribution Guide](https://github.com/SixLabors/ImageSharp/blob/master/.github/CONTRIBUTING.md) before opening a PR.
+Please... Spread the word, contribute algorithms, submit performance improvements, unit tests, no input is too little. Make sure to read our [Contribution Guide](https://github.com/SixLabors/ImageSharp/blob/main/.github/CONTRIBUTING.md) before opening a PR.
## The ImageSharp Team
@@ -94,40 +104,6 @@ Please... Spread the word, contribute algorithms, submit performance improvement
- [Scott Williams](https://github.com/tocsoft)
- [Brian Popow](https://github.com/brianpopow)
-## Sponsor Six Labors
-
-Support the efforts of the development of the Six Labors projects. [[Become a sponsor :heart:](https://opencollective.com/sixlabors#sponsor)]
-
-### Platinum Sponsors
-Become a platinum sponsor with a monthly donation of $2000 (providing 32 hours of maintenance and development) and get 2 hours of dedicated support (remote support available through chat or screen-sharing) per month.
-
-In addition you get your logo (large) on our README on GitHub and the home page (large) of sixlabors.com
-
-

-
-### Gold Sponsors
-Become a gold sponsor with a monthly donation of $1000 (providing 16 hours of maintenance and development) and get 1 hour of dedicated support (remote support available through chat or screen-sharing) per month.
-
-In addition you get your logo (large) on our README on GitHub and the home page (medium) of sixlabors.com
-
-











-
-### Silver Sponsors
-Become a silver sponsor with a monthly donation of $500 (providing 8 hours of maintenance and development) and get your logo (medium) on our README on GitHub and the product pages of sixlabors.com
-











-### Bronze Sponsors
-Become a bronze sponsor with a monthly donation of $100 and get your logo (small) on our README on GitHub.
-

-

-

-

-

-

-

-

-

-

-

\ No newline at end of file
diff --git a/codecov.yml b/codecov.yml
index 833fc0a51a..310eefb8c2 100644
--- a/codecov.yml
+++ b/codecov.yml
@@ -9,3 +9,14 @@ codecov:
# Avoid Report Expired
# https://docs.codecov.io/docs/codecov-yaml#section-expired-reports
max_report_age: off
+
+coverage:
+ # Use integer precision
+ # https://docs.codecov.com/docs/codecovyml-reference#coverageprecision
+ precision: 0
+
+ # Explicitly control coverage status checks
+ # https://docs.codecov.com/docs/commit-status#disabling-a-status
+ status:
+ project: on
+ patch: off
diff --git a/shared-infrastructure b/shared-infrastructure
index b0d4cd9864..59ce17f5a4 160000
--- a/shared-infrastructure
+++ b/shared-infrastructure
@@ -1 +1 @@
-Subproject commit b0d4cd98647996265a668e852574d901b27f22d6
+Subproject commit 59ce17f5a4e1f956811133f41add7638e74c2836
diff --git a/src/Directory.Build.props b/src/Directory.Build.props
index bdf1ff49cb..904d404f50 100644
--- a/src/Directory.Build.props
+++ b/src/Directory.Build.props
@@ -5,48 +5,29 @@
Directory.Build.props is automatically picked up and imported by
Microsoft.Common.props. This file needs to exist, even if empty so that
files in the parent directory tree, with the same name, are not imported
- instead. The import fairly early and only Sdk.props will have been
+ instead. They import fairly early and only Sdk.props will have been
imported beforehand. We also don't need to add ourselves to
MSBuildAllProjects, as that is done by the file that imports us.
-->
-
- $(MSBuildAllProjects);$(MSBuildThisFileDirectory)..\Directory.Build.props
- src
-
+
+
+
-
- $(MSBuildThisFileDirectory)..\shared-infrastructure\SixLabors.ruleset
- true
-
-
+
- true
+
-
-
- true
- true
-
-
-
- true
-
- true
- snupkg
-
-
-
-
-
-
+
+
+
+
+
-
-
diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets
index 1eeedecd2c..c15c2a90cc 100644
--- a/src/Directory.Build.targets
+++ b/src/Directory.Build.targets
@@ -5,82 +5,15 @@
Directory.Build.targets is automatically picked up and imported by
Microsoft.Common.targets. This file needs to exist, even if empty so that
files in the parent directory tree, with the same name, are not imported
- instead. The import fairly late and most other props/targets will have
+ instead. They import fairly late and most other props/targets will have
been imported beforehand. We also don't need to add ourselves to
MSBuildAllProjects, as that is done by the file that imports us.
-->
-
- $(MSBuildAllProjects);$(MSBuildThisFileDirectory)..\Directory.Build.targets
-
+
+
+
-
- $(IntermediateOutputPath)$(MSBuildProjectName).InternalsVisibleTo$(DefaultLanguageSourceExtension)
-
-
-
-
-
-
- <_LocalTopLevelSourceRoot Include="@(SourceRoot)" Condition="'%(SourceRoot.NestedRoot)' == ''"/>
-
-
-
-
-
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/ImageSharp/Advanced/AdvancedImageExtensions.cs b/src/ImageSharp/Advanced/AdvancedImageExtensions.cs
index c5abbda61b..829c6155db 100644
--- a/src/ImageSharp/Advanced/AdvancedImageExtensions.cs
+++ b/src/ImageSharp/Advanced/AdvancedImageExtensions.cs
@@ -23,7 +23,9 @@ public static class AdvancedImageExtensions
///
///
The source image.
///
The target file path to save the image to.
- ///
The matching encoder.
+ ///
The file path is null.
+ ///
No encoder available for provided path.
+ ///
The matching .
public static IImageEncoder DetectEncoder(this Image source, string filePath)
{
Guard.NotNull(filePath, nameof(filePath));
@@ -141,7 +143,7 @@ public static IMemoryGroup
GetPixelMemoryGroup(this ImageThe source.
/// The row.
/// The
- public static Memory GetPixelRowMemory(this ImageFrame source, int rowIndex)
+ public static Memory DangerousGetPixelRowMemory(this ImageFrame source, int rowIndex)
where TPixel : unmanaged, IPixel
{
Guard.NotNull(source, nameof(source));
@@ -159,7 +161,7 @@ public static Memory GetPixelRowMemory(this ImageFrame s
/// The source.
/// The row.
/// The
- public static Memory GetPixelRowMemory(this Image source, int rowIndex)
+ public static Memory DangerousGetPixelRowMemory(this Image source, int rowIndex)
where TPixel : unmanaged, IPixel
{
Guard.NotNull(source, nameof(source));
diff --git a/src/ImageSharp/Advanced/AotCompilerTools.cs b/src/ImageSharp/Advanced/AotCompilerTools.cs
index 2ea456286f..2323b5ba78 100644
--- a/src/ImageSharp/Advanced/AotCompilerTools.cs
+++ b/src/ImageSharp/Advanced/AotCompilerTools.cs
@@ -6,11 +6,29 @@
using System.Numerics;
using System.Runtime.CompilerServices;
using SixLabors.ImageSharp.Formats;
+using SixLabors.ImageSharp.Formats.Bmp;
+using SixLabors.ImageSharp.Formats.Gif;
+using SixLabors.ImageSharp.Formats.Jpeg;
using SixLabors.ImageSharp.Formats.Jpeg.Components;
+using SixLabors.ImageSharp.Formats.Pbm;
+using SixLabors.ImageSharp.Formats.Png;
+using SixLabors.ImageSharp.Formats.Tga;
+using SixLabors.ImageSharp.Formats.Tiff;
+using SixLabors.ImageSharp.Formats.Webp;
+using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing;
+using SixLabors.ImageSharp.Processing.Processors;
+using SixLabors.ImageSharp.Processing.Processors.Binarization;
+using SixLabors.ImageSharp.Processing.Processors.Convolution;
using SixLabors.ImageSharp.Processing.Processors.Dithering;
+using SixLabors.ImageSharp.Processing.Processors.Drawing;
+using SixLabors.ImageSharp.Processing.Processors.Effects;
+using SixLabors.ImageSharp.Processing.Processors.Filters;
+using SixLabors.ImageSharp.Processing.Processors.Normalization;
+using SixLabors.ImageSharp.Processing.Processors.Overlays;
using SixLabors.ImageSharp.Processing.Processors.Quantization;
+using SixLabors.ImageSharp.Processing.Processors.Transforms;
namespace SixLabors.ImageSharp.Advanced
{
@@ -25,180 +43,523 @@ namespace SixLabors.ImageSharp.Advanced
[ExcludeFromCodeCoverage]
internal static class AotCompilerTools
{
- static AotCompilerTools()
- {
- System.Runtime.CompilerServices.Unsafe.SizeOf();
- System.Runtime.CompilerServices.Unsafe.SizeOf();
- System.Runtime.CompilerServices.Unsafe.SizeOf();
- System.Runtime.CompilerServices.Unsafe.SizeOf();
- System.Runtime.CompilerServices.Unsafe.SizeOf();
- System.Runtime.CompilerServices.Unsafe.SizeOf();
- System.Runtime.CompilerServices.Unsafe.SizeOf();
- System.Runtime.CompilerServices.Unsafe.SizeOf();
- }
-
///
/// This is the method that seeds the AoT compiler.
/// None of these seed methods needs to actually be called to seed the compiler.
/// The calls just need to be present when the code is compiled, and each implementation will be built.
///
- private static void SeedEverything()
- {
- Seed();
- Seed();
- Seed();
- Seed();
- Seed();
- Seed();
- Seed();
- Seed();
- Seed();
- Seed();
- Seed();
- Seed();
- Seed();
- Seed();
- Seed();
- Seed();
- Seed();
- Seed();
- Seed();
- Seed();
- Seed();
- Seed();
- Seed();
- Seed();
- Seed();
- Seed();
- Seed();
- Seed();
+ ///
+ /// 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:
+ /// "Attempting to JIT compile method... OctreeFrameQuantizer.ConstructPalette... while running in aot-only mode."
+ /// The reason this happens is the SaveAsGif method makes heavy use of generics, which are too confusing for the AoT
+ /// compiler used on Xamarin.iOS. It spins up the JIT compiler to try and figure it out, but that is an illegal op on
+ /// iOS so it bombs out.
+ /// If you are getting the above error, you need to call this method, which will pre-seed the AoT compiler with the
+ /// necessary methods to complete the SaveAsGif call. That's it, otherwise you should NEVER need this method!!!
+ ///
+ [Preserve]
+ private static void SeedPixelFormats()
+ {
+ try
+ {
+ Unsafe.SizeOf();
+ Unsafe.SizeOf();
+ Unsafe.SizeOf();
+ Unsafe.SizeOf();
+ Unsafe.SizeOf();
+ Unsafe.SizeOf();
+ Unsafe.SizeOf();
+ Unsafe.SizeOf();
+ Unsafe.SizeOf();
+
+ Seed();
+ Seed();
+ Seed();
+ Seed();
+ Seed();
+ Seed();
+ Seed();
+ Seed();
+ Seed();
+ Seed();
+ Seed();
+ Seed();
+ Seed();
+ Seed();
+ Seed();
+ Seed();
+ Seed();
+ Seed();
+ Seed();
+ Seed();
+ Seed();
+ Seed();
+ Seed();
+ Seed();
+ Seed();
+ Seed();
+ Seed();
+ Seed();
+ Seed();
+ }
+ catch
+ {
+ // nop
+ }
+
+ throw new InvalidOperationException("This method is used for AOT code generation only. Do not call it at runtime.");
}
///
/// Seeds the compiler using the given pixel format.
///
/// The pixel format.
+ [Preserve]
private static void Seed()
where TPixel : unmanaged, IPixel
{
// This is we actually call all the individual methods you need to seed.
- AotCompileOctreeQuantizer();
- AotCompileWuQuantizer();
- AotCompilePaletteQuantizer();
- AotCompileDithering();
- AotCompilePixelOperations();
+ AotCompileImage();
+ AotCompileImageProcessingContextFactory();
+ AotCompileImageEncoderInternals();
+ AotCompileImageDecoderInternals();
+ AotCompileImageEncoders();
+ AotCompileImageDecoders();
+ AotCompileImageProcessors();
+ AotCompileGenericImageProcessors();
+ AotCompileResamplers();
+ AotCompileQuantizers();
+ AotCompilePixelSamplingStrategys();
+ AotCompileDithers();
+ AotCompileMemoryManagers();
Unsafe.SizeOf();
- AotCodec(new Formats.Png.PngDecoder(), new Formats.Png.PngEncoder());
- AotCodec(new Formats.Bmp.BmpDecoder(), new Formats.Bmp.BmpEncoder());
- AotCodec(new Formats.Gif.GifDecoder(), new Formats.Gif.GifEncoder());
- AotCodec(new Formats.Jpeg.JpegDecoder(), new Formats.Jpeg.JpegEncoder());
-
// TODO: Do the discovery work to figure out what works and what doesn't.
}
///
- /// 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:
- /// "Attempting to JIT compile method... OctreeFrameQuantizer.ConstructPalette... while running in aot-only mode."
- /// The reason this happens is the SaveAsGif method makes heavy use of generics, which are too confusing for the AoT
- /// compiler used on Xamarin.iOS. It spins up the JIT compiler to try and figure it out, but that is an illegal op on
- /// iOS so it bombs out.
- /// If you are getting the above error, you need to call this method, which will pre-seed the AoT compiler with the
- /// necessary methods to complete the SaveAsGif call. That's it, otherwise you should NEVER need this method!!!
+ /// This method pre-seeds the for a given pixel format in the AoT compiler.
///
/// The pixel format.
- private static void AotCompileOctreeQuantizer()
+ [Preserve]
+ private static unsafe void AotCompileImage()
where TPixel : unmanaged, IPixel
{
- using (var test = new OctreeQuantizer(Configuration.Default, new OctreeQuantizer().Options))
- {
- var frame = new ImageFrame(Configuration.Default, 1, 1);
- test.QuantizeFrame(frame, frame.Bounds());
- }
+ Image img = default;
+ img.CloneAs(default);
+ img.CloneAs(default);
+ img.CloneAs(default);
+ img.CloneAs(default);
+ img.CloneAs(default);
+ img.CloneAs(default);
+ img.CloneAs(default);
+ img.CloneAs(default);
+ img.CloneAs(default);
+ img.CloneAs(default);
+ img.CloneAs(default);
+ img.CloneAs(default);
+ img.CloneAs(default);
+ img.CloneAs(default);
+ img.CloneAs(default);
+ img.CloneAs(default);
+ img.CloneAs(default);
+ img.CloneAs(default);
+ img.CloneAs(default);
+ img.CloneAs(default);
+ img.CloneAs(default);
+ img.CloneAs(default);
+ img.CloneAs(default);
+ img.CloneAs(default);
+ img.CloneAs(default);
+ img.CloneAs(default);
+ img.CloneAs(default);
+ img.CloneAs(default);
+ img.CloneAs(default);
+
+ ImageFrame.LoadPixelData(default, default(ReadOnlySpan), default, default);
+ ImageFrame.LoadPixelData(default, default(ReadOnlySpan), default, default);
}
///
- /// This method pre-seeds the WuQuantizer in the AoT compiler for iOS.
+ /// This method pre-seeds the all in the AoT compiler.
///
/// The pixel format.
- private static void AotCompileWuQuantizer()
+ [Preserve]
+ private static void AotCompileImageProcessingContextFactory()
+ where TPixel : unmanaged, IPixel
+ => default(DefaultImageOperationsProviderFactory).CreateImageProcessingContext(default, default, default);
+
+ ///
+ /// This method pre-seeds the all in the AoT compiler.
+ ///
+ /// The pixel format.
+ [Preserve]
+ private static void AotCompileImageEncoderInternals()
where TPixel : unmanaged, IPixel
{
- using (var test = new WuQuantizer(Configuration.Default, new WuQuantizer().Options))
- {
- var frame = new ImageFrame(Configuration.Default, 1, 1);
- test.QuantizeFrame(frame, frame.Bounds());
- }
+ default(WebpEncoderCore).Encode(default, default, default);
+ default(BmpEncoderCore).Encode(default, default, default);
+ default(GifEncoderCore).Encode(default, default, default);
+ default(JpegEncoderCore).Encode(default, default, default);
+ default(PbmEncoderCore).Encode(default, default, default);
+ default(PngEncoderCore).Encode(default, default, default);
+ default(TgaEncoderCore).Encode(default, default, default);
+ default(TiffEncoderCore).Encode(default, default, default);
}
///
- /// This method pre-seeds the PaletteQuantizer in the AoT compiler for iOS.
+ /// This method pre-seeds the all in the AoT compiler.
///
/// The pixel format.
- private static void AotCompilePaletteQuantizer()
+ [Preserve]
+ private static void AotCompileImageDecoderInternals()
where TPixel : unmanaged, IPixel
{
- using (var test = (PaletteQuantizer)new PaletteQuantizer(Array.Empty()).CreatePixelSpecificQuantizer(Configuration.Default))
- {
- var frame = new ImageFrame(Configuration.Default, 1, 1);
- test.QuantizeFrame(frame, frame.Bounds());
- }
+ default(WebpDecoderCore).Decode(default, default, default);
+ default(BmpDecoderCore).Decode(default, default, default);
+ default(GifDecoderCore).Decode(default, default, default);
+ default(JpegDecoderCore).Decode(default, default, default);
+ default(PbmDecoderCore).Decode(default, default, default);
+ default(PngDecoderCore).Decode(default, default, default);
+ default(TgaDecoderCore).Decode(default, default, default);
+ default(TiffDecoderCore).Decode(default, default, default);
+ }
+
+ ///
+ /// This method pre-seeds the all in the AoT compiler.
+ ///
+ /// The pixel format.
+ [Preserve]
+ private static void AotCompileImageEncoders()
+ where TPixel : unmanaged, IPixel
+ {
+ AotCompileImageEncoder();
+ AotCompileImageEncoder();
+ AotCompileImageEncoder();
+ AotCompileImageEncoder();
+ AotCompileImageEncoder();
+ AotCompileImageEncoder();
+ AotCompileImageEncoder();
+ AotCompileImageEncoder();
}
///
- /// This method pre-seeds the default dithering engine (FloydSteinbergDiffuser) in the AoT compiler for iOS.
+ /// This method pre-seeds the all in the AoT compiler.
///
/// The pixel format.
- private static void AotCompileDithering()
+ [Preserve]
+ private static void AotCompileImageDecoders()
where TPixel : unmanaged, IPixel
{
- ErrorDither errorDither = ErrorDither.FloydSteinberg;
- OrderedDither orderedDither = OrderedDither.Bayer2x2;
- TPixel pixel = default;
- using (var image = new ImageFrame(Configuration.Default, 1, 1))
- {
- errorDither.Dither(image, image.Bounds(), pixel, pixel, 0, 0, 0);
- orderedDither.Dither(pixel, 0, 0, 0, 0);
- }
+ AotCompileImageDecoder();
+ AotCompileImageDecoder();
+ AotCompileImageDecoder();
+ AotCompileImageDecoder();
+ AotCompileImageDecoder();
+ AotCompileImageDecoder();
+ AotCompileImageDecoder();
+ AotCompileImageDecoder();
}
///
- /// This method pre-seeds the decoder and encoder for a given pixel format in the AoT compiler for iOS.
+ /// This method pre-seeds the in the AoT compiler.
///
- /// The image decoder to seed.
- /// The image encoder to seed.
/// The pixel format.
- private static void AotCodec(IImageDecoder decoder, IImageEncoder encoder)
+ /// The encoder.
+ [Preserve]
+ private static void AotCompileImageEncoder()
where TPixel : unmanaged, IPixel
+ where TEncoder : class, IImageEncoder
{
- try
- {
- decoder.Decode(Configuration.Default, null);
- }
- catch
- {
- }
+ default(TEncoder).Encode(default, default);
+ default(TEncoder).EncodeAsync(default, default, default);
+ }
- try
- {
- encoder.Encode(null, null);
- }
- catch
- {
- }
+ ///
+ /// This method pre-seeds the in the AoT compiler.
+ ///
+ /// The pixel format.
+ /// The decoder.
+ [Preserve]
+ private static void AotCompileImageDecoder()
+ where TPixel : unmanaged, IPixel
+ where TDecoder : class, IImageDecoder
+ {
+ default(TDecoder).Decode(default, default, default);
+ }
+
+ ///
+ /// This method pre-seeds the all in the AoT compiler.
+ ///
+ ///
+ /// There is no structure that implements ISwizzler.
+ ///
+ /// The pixel format.
+ [Preserve]
+ private static void AotCompileImageProcessors()
+ where TPixel : unmanaged, IPixel
+ {
+ AotCompileImageProcessor();
+ AotCompileImageProcessor();
+ AotCompileImageProcessor();
+ AotCompileImageProcessor();
+ AotCompileImageProcessor();
+ AotCompileImageProcessor();
+ AotCompileImageProcessor();
+ AotCompileImageProcessor();
+ AotCompileImageProcessor();
+ AotCompileImageProcessor();
+ AotCompileImageProcessor();
+ AotCompileImageProcessor();
+ AotCompileImageProcessor();
+ AotCompileImageProcessor();
+ AotCompileImageProcessor();
+ AotCompileImageProcessor();
+ AotCompileImageProcessor();
+ AotCompileImageProcessor();
+ AotCompileImageProcessor();
+ AotCompileImageProcessor();
+ AotCompileImageProcessor();
+ AotCompileImageProcessor();
+ AotCompileImageProcessor();
+ AotCompileImageProcessor();
+ AotCompileImageProcessor();
+ AotCompileImageProcessor();
+ AotCompileImageProcessor();
+ AotCompileImageProcessor