Browse Source

Add test case for pxr compression with pixel type uint

pull/3124/head
Brian Popow 2 weeks ago
parent
commit
e8c9d6db9d
  1. 12
      tests/ImageSharp.Tests/Formats/Exr/ExrDecoderTests.cs
  2. 1
      tests/ImageSharp.Tests/TestImages.cs
  3. 3
      tests/Images/External/ReferenceOutput/ExrDecoderTests/ExrDecoder_CanDecode_Pxr24Compressed_ExrPixelType_Uint_Rgba32_Calliphora_uint_pxr24.png
  4. 3
      tests/Images/Input/Exr/Calliphora_uint_pxr24.exr

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

@ -130,6 +130,18 @@ public class ExrDecoderTests
image.CompareToOriginal(provider, ImageComparer.Exact, ReferenceDecoder);
}
[Theory]
[WithFile(TestImages.Exr.Pxr24Uint, PixelTypes.Rgba32)]
public void ExrDecoder_CanDecode_Pxr24Compressed_ExrPixelType_Uint<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
using Image<TPixel> image = provider.GetImage(ExrDecoder.Instance);
image.DebugSave(provider);
// Compare to Reference here instead using the reference decoder, since uint pixel type is not supported by the Reference decoder.
image.CompareToReferenceOutput(provider);
}
[Theory]
[WithFile(TestImages.Exr.B44, PixelTypes.Rgba32)]
public void ExrDecoder_CanDecode_B44Compressed<TPixel>(TestImageProvider<TPixel> provider)

1
tests/ImageSharp.Tests/TestImages.cs

@ -1397,6 +1397,7 @@ public static class TestImages
public const string B44 = "Exr/Calliphora_b44.exr";
public const string Pxr24Half = "Exr/Calliphora_half_pxr24.exr";
public const string Pxr24Float = "Exr/Calliphora_float_pxr24.exr";
public const string Pxr24Uint = "Exr/Calliphora_uint_pxr24.exr";
public const string Rgb = "Exr/Calliphora_rgb.exr";
public const string Gray = "Exr/Calliphora_gray.exr";
}

3
tests/Images/External/ReferenceOutput/ExrDecoderTests/ExrDecoder_CanDecode_Pxr24Compressed_ExrPixelType_Uint_Rgba32_Calliphora_uint_pxr24.png

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f66bf45b5d80e412314341567b8cf240d56b5872f01ce9f3b0d6034d85e8e942
size 163327

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

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