Browse Source

Add tests for topleft origin

af/merge-core
Brian Popow 7 years ago
parent
commit
e12873c115
  1. 24
      tests/ImageSharp.Tests/Formats/Tga/TgaDecoderTests.cs
  2. 2
      tests/ImageSharp.Tests/TestImages.cs
  3. 3
      tests/Images/Input/Tga/targa_24bit_origin_topleft.tga
  4. 3
      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";

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

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

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

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