Browse Source

Add RLE test images

af/merge-core
Brian Popow 7 years ago
parent
commit
7a8a132558
  1. 48
      tests/ImageSharp.Tests/Formats/Tga/TgaDecoderTests.cs
  2. 4
      tests/ImageSharp.Tests/TestImages.cs
  3. 3
      tests/Images/Input/Tga/bike_16bit_rle.tga
  4. 3
      tests/Images/Input/Tga/bike_24bit_rle.tga
  5. 3
      tests/Images/Input/Tga/bike_32bit_rle.tga
  6. 3
      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) private void CompareWithReferenceDecoder<TPixel>(TestImageProvider<TPixel> provider, Image<TPixel> image)
where TPixel : struct, IPixel<TPixel> 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 Bit24 = "Tga/bike_24bit.tga";
public const string Bit16 = "Tga/bike_16bit.tga"; public const string Bit16 = "Tga/bike_16bit.tga";
public const string Grey = "Tga/bike_8bit.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";
} }
} }
} }

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

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

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

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

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

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

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

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