Browse Source

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

pull/1160/head
Brian Popow 6 years ago
parent
commit
b164883a41
  1. 144
      tests/ImageSharp.Tests/Formats/Tga/TgaDecoderTests.cs
  2. 12
      tests/ImageSharp.Tests/TestImages.cs
  3. BIN
      tests/Images/Input/Tga/indexed_a_LL.tga
  4. BIN
      tests/Images/Input/Tga/indexed_a_LR.tga
  5. BIN
      tests/Images/Input/Tga/indexed_a_UL.tga
  6. BIN
      tests/Images/Input/Tga/indexed_a_UR.tga
  7. BIN
      tests/Images/Input/Tga/rgb_LR.tga
  8. BIN
      tests/Images/Input/Tga/rgb_UR.tga
  9. BIN
      tests/Images/Input/Tga/rgb_a_LR.tga
  10. BIN
      tests/Images/Input/Tga/rgb_a_UR.tga
  11. BIN
      tests/Images/Input/Tga/rgb_a_rle_LR.tga
  12. BIN
      tests/Images/Input/Tga/rgb_a_rle_UR.tga
  13. BIN
      tests/Images/Input/Tga/rgb_rle_LR.tga
  14. BIN
      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";

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 KiB

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.
Loading…
Cancel
Save