Browse Source

Test case for pixel type uint

pull/3096/head
Brian Popow 2 months ago
parent
commit
fc40209727
  1. 10
      tests/ImageSharp.Tests/Formats/Exr/ExrDecoderTests.cs
  2. 3
      tests/ImageSharp.Tests/TestImages.cs
  3. 3
      tests/Images/Input/Exr/rgb_uint32_uncompressed.exr

10
tests/ImageSharp.Tests/Formats/Exr/ExrDecoderTests.cs

@ -45,6 +45,16 @@ public class ExrDecoderTests
image.CompareToOriginal(provider, ReferenceDecoder); image.CompareToOriginal(provider, ReferenceDecoder);
} }
[Theory]
[WithFile(TestImages.Exr.UncompressedUintRgb, PixelTypes.Rgba32)]
public void ExrDecoder_CanDecode_Uncompressed_Rgb_ExrPixelType_Uint<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
using Image<TPixel> image = provider.GetImage(ExrDecoder.Instance);
image.DebugSave(provider);
image.CompareToOriginal(provider, ReferenceDecoder);
}
[Theory] [Theory]
[WithFile(TestImages.Exr.Rgb, PixelTypes.Rgba32)] [WithFile(TestImages.Exr.Rgb, PixelTypes.Rgba32)]
public void ExrDecoder_CanDecode_Rgb<TPixel>(TestImageProvider<TPixel> provider) public void ExrDecoder_CanDecode_Rgb<TPixel>(TestImageProvider<TPixel> provider)

3
tests/ImageSharp.Tests/TestImages.cs

@ -1384,12 +1384,13 @@ public static class TestImages
public static class Exr public static class Exr
{ {
public const string Uncompressed = "Exr/Calliphora_uncompressed.exr"; public const string Uncompressed = "Exr/Calliphora_uncompressed.exr";
public const string UncompressedFloatRgb = "Exr/rgb_float32_uncompressed.exr";
public const string UncompressedUintRgb = "Exr/rgb_uint32_uncompressed.exr";
public const string Zip = "Exr/Calliphora_zip.exr"; public const string Zip = "Exr/Calliphora_zip.exr";
public const string Zips = "Exr/Calliphora_zips.exr"; public const string Zips = "Exr/Calliphora_zips.exr";
public const string Rle = "Exr/Calliphora_rle.exr"; public const string Rle = "Exr/Calliphora_rle.exr";
public const string B44 = "Exr/Calliphora_b44.exr"; public const string B44 = "Exr/Calliphora_b44.exr";
public const string Rgb = "Exr/Calliphora_rgb.exr"; public const string Rgb = "Exr/Calliphora_rgb.exr";
public const string Gray = "Exr/Calliphora_gray.exr"; public const string Gray = "Exr/Calliphora_gray.exr";
public const string UncompressedFloatRgb = "Exr/rgb_float32_uncompressed.exr";
} }
} }

3
tests/Images/Input/Exr/rgb_uint32_uncompressed.exr

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8de6e6f5b1c5acfc67d84e228c45f47ec16a1635f90fd484dfaeb89c28278f10
size 101408
Loading…
Cancel
Save