diff --git a/ImageSharp.sln.DotSettings b/ImageSharp.sln.DotSettings index fb607752a9..5acec071a1 100644 --- a/ImageSharp.sln.DotSettings +++ b/ImageSharp.sln.DotSettings @@ -349,6 +349,7 @@ RGB RLE XY + XYZ $object$_On$event$ <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> diff --git a/tests/ImageSharp.Tests/Formats/Jpg/JpegTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/JpegTests.cs index 35b1ff0d93..48d5454f6e 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/JpegTests.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/JpegTests.cs @@ -68,11 +68,14 @@ namespace ImageSharp.Tests TestImages.Jpeg.Cmyk }; + private const PixelTypes BenchmarkPixels = PixelTypes.StandardImageClass; + //PixelTypes.Color | PixelTypes.StandardImageClass | PixelTypes.Argb; + [Theory( //Skip = "Benchmark, enable manually!" )] - [WithFileCollection(nameof(AllBmpFiles), PixelTypes.Color | PixelTypes.StandardImageClass | PixelTypes.Argb, JpegSubsample.Ratio420, 75)] - [WithFileCollection(nameof(AllBmpFiles), PixelTypes.Color | PixelTypes.StandardImageClass | PixelTypes.Argb, JpegSubsample.Ratio444, 75)] + [WithFileCollection(nameof(BenchmarkFiles), BenchmarkPixels, JpegSubsample.Ratio420, 75)] + [WithFileCollection(nameof(BenchmarkFiles), BenchmarkPixels, JpegSubsample.Ratio444, 75)] public void Benchmark_JpegEncoder(TestImageProvider provider, JpegSubsample subSample, int quality) where TColor : struct, IPackedPixel, IEquatable { diff --git a/tests/ImageSharp.Tests/TestUtilities/Factories/GenericFactory.cs b/tests/ImageSharp.Tests/TestUtilities/Factories/GenericFactory.cs index 8e164cb3c2..c2f0aed84e 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Factories/GenericFactory.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Factories/GenericFactory.cs @@ -23,5 +23,10 @@ namespace ImageSharp.Tests { return new Image(bytes); } + + public virtual Image CreateImage(Image other) + { + return new Image(other); + } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/TestUtilities/Factories/ImageFactory.cs b/tests/ImageSharp.Tests/TestUtilities/Factories/ImageFactory.cs index 288dbdd8c6..a8d398c1e8 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Factories/ImageFactory.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Factories/ImageFactory.cs @@ -10,5 +10,11 @@ namespace ImageSharp.Tests public override Image CreateImage(byte[] bytes) => new Image(bytes); public override Image CreateImage(int width, int height) => new Image(width, height); + + public override Image CreateImage(Image other) + { + Image img = (Image)other; + return new Image(img); + } } } diff --git a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/FileProvider.cs b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/FileProvider.cs index a2848ff6f0..1b8c1498ef 100644 --- a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/FileProvider.cs +++ b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/FileProvider.cs @@ -47,7 +47,7 @@ namespace ImageSharp.Tests return this.Factory.CreateImage(testFile.Bytes); }); - return new Image(cachedImage); + return this.Factory.CreateImage(cachedImage); } } } diff --git a/tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs b/tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs index 28e5ad2c2b..31014f89dc 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs @@ -57,6 +57,7 @@ namespace ImageSharp.Tests [Theory] [WithBlankImages(1, 1, PixelTypes.StandardImageClass)] + [WithFile(TestImages.Bmp.F, PixelTypes.StandardImageClass)] public void PixelTypes_ColorWithDefaultImageClass_TriggersCreatingTheNonGenericDerivedImageClass( TestImageProvider provider) where TColor : struct, IPackedPixel, IEquatable