Browse Source

Add additional tests for images which have bottom right and top right origin

pull/1574/head
Brian Popow 6 years ago
parent
commit
96ff5b8b14
  1. 144
      tests/ImageSharp.Tests/Formats/Tga/TgaDecoderTests.cs
  2. 12
      tests/ImageSharp.Tests/TestImages.cs
  3. 3
      tests/Images/Input/Tga/indexed_a_LL.tga
  4. 3
      tests/Images/Input/Tga/indexed_a_LR.tga
  5. 3
      tests/Images/Input/Tga/indexed_a_UL.tga
  6. 3
      tests/Images/Input/Tga/indexed_a_UR.tga
  7. 3
      tests/Images/Input/Tga/rgb_LR.tga
  8. 3
      tests/Images/Input/Tga/rgb_UR.tga
  9. 3
      tests/Images/Input/Tga/rgb_a_LR.tga
  10. 3
      tests/Images/Input/Tga/rgb_a_UR.tga
  11. 3
      tests/Images/Input/Tga/rgb_a_rle_LR.tga
  12. 3
      tests/Images/Input/Tga/rgb_a_rle_UR.tga
  13. 3
      tests/Images/Input/Tga/rgb_rle_LR.tga
  14. 3
      tests/Images/Input/Tga/rgb_rle_UR.tga

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

@ -187,6 +187,30 @@ namespace SixLabors.ImageSharp.Tests.Formats.Tga
}
}
[Theory]
[WithFile(Bit24TopRight, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_Uncompressed_WithTopRightOrigin_24Bit<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
using (Image<TPixel> image = provider.GetImage(TgaDecoder))
{
image.DebugSave(provider);
TgaTestUtils.CompareWithReferenceDecoder(provider, image);
}
}
[Theory]
[WithFile(Bit24BottomRight, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_Uncompressed_WithBottomRightOrigin_24Bit<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
using (Image<TPixel> image = provider.GetImage(TgaDecoder))
{
image.DebugSave(provider);
TgaTestUtils.CompareWithReferenceDecoder(provider, image);
}
}
[Theory]
[WithFile(Bit24RleTopLeft, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_RunLengthEncoded_WithTopLeftOrigin_24Bit<TPixel>(TestImageProvider<TPixel> provider)
@ -199,6 +223,30 @@ namespace SixLabors.ImageSharp.Tests.Formats.Tga
}
}
[Theory]
[WithFile(Bit24RleTopRight, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_RunLengthEncoded_WithTopRightOrigin_24Bit<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
using (Image<TPixel> image = provider.GetImage(TgaDecoder))
{
image.DebugSave(provider);
TgaTestUtils.CompareWithReferenceDecoder(provider, image);
}
}
[Theory]
[WithFile(Bit24RleBottomRight, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_RunLengthEncoded_WithBottomRightOrigin_24Bit<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
using (Image<TPixel> image = provider.GetImage(TgaDecoder))
{
image.DebugSave(provider);
TgaTestUtils.CompareWithReferenceDecoder(provider, image);
}
}
[Theory]
[WithFile(Bit24TopLeft, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_Palette_WithTopLeftOrigin_24Bit<TPixel>(TestImageProvider<TPixel> provider)
@ -223,6 +271,30 @@ namespace SixLabors.ImageSharp.Tests.Formats.Tga
}
}
[Theory]
[WithFile(Bit32BottomRight, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_Uncompressed_WithBottomRightOrigin_32Bit<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
using (Image<TPixel> image = provider.GetImage(TgaDecoder))
{
image.DebugSave(provider);
TgaTestUtils.CompareWithReferenceDecoder(provider, image);
}
}
[Theory]
[WithFile(Bit32TopRight, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_Uncompressed_WithTopRightOrigin_32Bit<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
using (Image<TPixel> image = provider.GetImage(TgaDecoder))
{
image.DebugSave(provider);
TgaTestUtils.CompareWithReferenceDecoder(provider, image);
}
}
[Theory]
[WithFile(Bit16Rle, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_RunLengthEncoded_16Bit<TPixel>(TestImageProvider<TPixel> provider)
@ -259,6 +331,30 @@ namespace SixLabors.ImageSharp.Tests.Formats.Tga
}
}
[Theory]
[WithFile(Bit32RleTopRight, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_RunLengthEncoded_WithTopRightOrigin_32Bit<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
using (Image<TPixel> image = provider.GetImage(TgaDecoder))
{
image.DebugSave(provider);
TgaTestUtils.CompareWithReferenceDecoder(provider, image);
}
}
[Theory]
[WithFile(Bit32RleBottomRight, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_RunLengthEncoded_WithBottomRightOrigin_32Bit<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
using (Image<TPixel> image = provider.GetImage(TgaDecoder))
{
image.DebugSave(provider);
TgaTestUtils.CompareWithReferenceDecoder(provider, image);
}
}
[Theory]
[WithFile(Bit16Pal, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_WithPalette_16Bit<TPixel>(TestImageProvider<TPixel> provider)
@ -283,6 +379,54 @@ namespace SixLabors.ImageSharp.Tests.Formats.Tga
}
}
[Theory]
[WithFile(Bit32Pal, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_WithPalette_32Bit<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
using (Image<TPixel> image = provider.GetImage(TgaDecoder))
{
image.DebugSave(provider);
TgaTestUtils.CompareWithReferenceDecoder(provider, image);
}
}
[Theory]
[WithFile(Bit32PalBottomLeft, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_WithPalette_WithBottomLeftOrigin_32Bit<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
using (Image<TPixel> image = provider.GetImage(TgaDecoder))
{
image.DebugSave(provider);
TgaTestUtils.CompareWithReferenceDecoder(provider, image);
}
}
[Theory]
[WithFile(Bit32PalBottomRight, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_WithPalette_WithBottomRightOrigin_32Bit<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
using (Image<TPixel> image = provider.GetImage(TgaDecoder))
{
image.DebugSave(provider);
TgaTestUtils.CompareWithReferenceDecoder(provider, image);
}
}
[Theory]
[WithFile(Bit32PalTopRight, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_WithPalette_WithTopRightOrigin_32Bit<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
using (Image<TPixel> image = provider.GetImage(TgaDecoder))
{
image.DebugSave(provider);
TgaTestUtils.CompareWithReferenceDecoder(provider, image);
}
}
[Theory]
[WithFile(NoAlphaBits16Bit, PixelTypes.Rgba32)]
[WithFile(NoAlphaBits16BitRle, PixelTypes.Rgba32)]

12
tests/ImageSharp.Tests/TestImages.cs

@ -380,9 +380,21 @@ 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 Bit24TopRight = "Tga/rgb_UR.tga";
public const string Bit24BottomRight = "Tga/rgb_LR.tga";
public const string Bit24TopLeft = "Tga/targa_24bit_pal_origin_topleft.tga";
public const string Bit24RleTopLeft = "Tga/targa_24bit_rle_origin_topleft.tga";
public const string Bit24RleTopRight = "Tga/rgb_rle_UR.tga";
public const string Bit24RleBottomRight = "Tga/rgb_rle_LR.tga";
public const string Bit32 = "Tga/targa_32bit.tga";
public const string Bit32Pal = "Tga/indexed_a_UL.tga";
public const string Bit32PalBottomLeft = "Tga/indexed_a_LL.tga";
public const string Bit32PalBottomRight = "Tga/indexed_a_LR.tga";
public const string Bit32PalTopRight = "Tga/indexed_a_UR.tga";
public const string Bit32TopRight = "Tga/rgb_a_UR.tga";
public const string Bit32BottomRight = "Tga/rgb_a_LR.tga";
public const string Bit32RleTopRight = "Tga/rgb_a_rle_UR.tga";
public const string Bit32RleBottomRight = "Tga/rgb_a_rle_LR.tga";
public const string Gray8Bit = "Tga/targa_8bit.tga";
public const string Gray8BitRle = "Tga/targa_8bit_rle.tga";
public const string Gray16Bit = "Tga/grayscale_a_UL.tga";

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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