Browse Source

Add tests for topleft origin

pull/1026/head
Brian Popow 7 years ago
parent
commit
6fda29b271
  1. 24
      tests/ImageSharp.Tests/Formats/Tga/TgaDecoderTests.cs
  2. 2
      tests/ImageSharp.Tests/TestImages.cs
  3. BIN
      tests/Images/Input/Tga/targa_24bit_origin_topleft.tga
  4. BIN
      tests/Images/Input/Tga/targa_24bit_rle_origin_topleft.tga

24
tests/ImageSharp.Tests/Formats/Tga/TgaDecoderTests.cs

@ -91,6 +91,30 @@ namespace SixLabors.ImageSharp.Tests.Formats.Tga
}
}
[Theory]
[WithFile(Bit24RleTopLeft, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_RunLengthEncoded_WithTopLeftOrigin_24Bit<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : struct, IPixel<TPixel>
{
using (Image<TPixel> image = provider.GetImage(new TgaDecoder()))
{
image.DebugSave(provider);
CompareWithReferenceDecoder(provider, image);
}
}
[Theory]
[WithFile(Bit24TopLeft, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_Uncompressed_WithTopLeftOrigin_24Bit<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : struct, IPixel<TPixel>
{
using (Image<TPixel> image = provider.GetImage(new TgaDecoder()))
{
image.DebugSave(provider);
CompareWithReferenceDecoder(provider, image);
}
}
[Theory]
[WithFile(Bit32, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_Uncompressed_32Bit<TPixel>(TestImageProvider<TPixel> provider)

2
tests/ImageSharp.Tests/TestImages.cs

@ -373,6 +373,8 @@ namespace SixLabors.ImageSharp.Tests
public const string Bit16 = "Tga/targa_16bit.tga";
public const string Bit16PalRle = "Tga/ccm8.tga";
public const string Bit24 = "Tga/targa_24bit.tga";
public const string Bit24TopLeft = "Tga/targa_24bit_origin_topleft.tga";
public const string Bit24RleTopLeft = "Tga/targa_24bit_rle_origin_topleft.tga";
public const string Bit32 = "Tga/targa_32bit.tga";
public const string Grey = "Tga/targa_8bit.tga";
public const string GreyRle = "Tga/targa_8bit_rle.tga";

BIN
tests/Images/Input/Tga/targa_24bit_origin_topleft.tga

Binary file not shown.

BIN
tests/Images/Input/Tga/targa_24bit_rle_origin_topleft.tga

Binary file not shown.
Loading…
Cancel
Save