Browse Source

Add RLE test images

pull/1026/head
Brian Popow 6 years ago
parent
commit
5037380cce
  1. 48
      tests/ImageSharp.Tests/Formats/Tga/TgaDecoderTests.cs
  2. 4
      tests/ImageSharp.Tests/TestImages.cs
  3. BIN
      tests/Images/Input/Tga/bike_16bit_rle.tga
  4. BIN
      tests/Images/Input/Tga/bike_24bit_rle.tga
  5. BIN
      tests/Images/Input/Tga/bike_32bit_rle.tga
  6. BIN
      tests/Images/Input/Tga/bike_8bit_rle.tga

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

@ -67,6 +67,54 @@ namespace SixLabors.ImageSharp.Tests.Formats.Tga
}
}
[Theory]
[WithFile(GreyRle, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_RunLenghtEncoded_MonoChrome<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(Bit16Rle, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_RunLenghtEncoded_16Bit<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(Bit24Rle, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_RunLenghtEncoded_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(Bit32Rle, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_RunLenghtEncoded_32Bit<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : struct, IPixel<TPixel>
{
using (Image<TPixel> image = provider.GetImage(new TgaDecoder()))
{
image.DebugSave(provider);
CompareWithReferenceDecoder(provider, image);
}
}
private void CompareWithReferenceDecoder<TPixel>(TestImageProvider<TPixel> provider, Image<TPixel> image)
where TPixel : struct, IPixel<TPixel>
{

4
tests/ImageSharp.Tests/TestImages.cs

@ -372,6 +372,10 @@ namespace SixLabors.ImageSharp.Tests
public const string Bit24 = "Tga/bike_24bit.tga";
public const string Bit16 = "Tga/bike_16bit.tga";
public const string Grey = "Tga/bike_8bit.tga";
public const string Bit32Rle = "Tga/bike_32bit_rle.tga";
public const string Bit24Rle = "Tga/bike_24bit_rle.tga";
public const string Bit16Rle = "Tga/bike_16bit_rle.tga";
public const string GreyRle = "Tga/bike_8bit_rle.tga";
}
}
}

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.
Loading…
Cancel
Save