|
|
|
@ -31,6 +31,30 @@ namespace SixLabors.ImageSharp.Tests.Formats.Tga |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
[Theory] |
|
|
|
[WithFile(Bit15, PixelTypes.Rgba32)] |
|
|
|
public void TgaDecoder_CanDecode_Uncompressed_15Bit<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(Bit15Rle, PixelTypes.Rgba32)] |
|
|
|
public void TgaDecoder_CanDecode_RunLengthEncoded_15Bit<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(Bit16, PixelTypes.Rgba32)] |
|
|
|
public void TgaDecoder_CanDecode_Uncompressed_16Bit<TPixel>(TestImageProvider<TPixel> provider) |
|
|
|
@ -43,6 +67,18 @@ namespace SixLabors.ImageSharp.Tests.Formats.Tga |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
[Theory] |
|
|
|
[WithFile(Bit16PalRle, PixelTypes.Rgba32)] |
|
|
|
public void TgaDecoder_CanDecode_RunLengthEncoded_WithPalette_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(Bit24, PixelTypes.Rgba32)] |
|
|
|
public void TgaDecoder_CanDecode_Uncompressed_24Bit<TPixel>(TestImageProvider<TPixel> provider) |
|
|
|
@ -115,6 +151,30 @@ namespace SixLabors.ImageSharp.Tests.Formats.Tga |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
[Theory] |
|
|
|
[WithFile(Bit16Pal, PixelTypes.Rgba32)] |
|
|
|
public void TgaDecoder_CanDecode_WithPalette_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(Bit24Pal, PixelTypes.Rgba32)] |
|
|
|
public void TgaDecoder_CanDecode_WithPalette_24Bit<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> |
|
|
|
{ |
|
|
|
|