mirror of https://github.com/SixLabors/ImageSharp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.6 KiB
41 lines
1.6 KiB
// Copyright (c) Six Labors.
|
|
// Licensed under the Six Labors Split License.
|
|
|
|
using SixLabors.ImageSharp.Formats.Bmp;
|
|
using SixLabors.ImageSharp.Formats.Cur;
|
|
using SixLabors.ImageSharp.Formats.Icon;
|
|
using SixLabors.ImageSharp.PixelFormats;
|
|
using static SixLabors.ImageSharp.Tests.TestImages.Cur;
|
|
|
|
namespace SixLabors.ImageSharp.Tests.Formats.Icon.Cur;
|
|
|
|
[Trait("Format", "Cur")]
|
|
[ValidateDisposedMemoryAllocations]
|
|
public class CurDecoderTests
|
|
{
|
|
[Theory]
|
|
[WithFile(WindowsMouse, PixelTypes.Rgba32)]
|
|
public void CurDecoder_Decode(TestImageProvider<Rgba32> provider)
|
|
{
|
|
using Image<Rgba32> image = provider.GetImage(CurDecoder.Instance);
|
|
|
|
CurFrameMetadata meta = image.Frames[0].Metadata.GetCurMetadata();
|
|
Assert.Equal(image.Width, meta.EncodingWidth.Value);
|
|
Assert.Equal(image.Height, meta.EncodingHeight.Value);
|
|
Assert.Equal(IconFrameCompression.Bmp, meta.Compression);
|
|
Assert.Equal(BmpBitsPerPixel.Bit32, meta.BmpBitsPerPixel);
|
|
}
|
|
|
|
[Theory]
|
|
[WithFile(CurFake, PixelTypes.Rgba32)]
|
|
[WithFile(CurReal, PixelTypes.Rgba32)]
|
|
public void CurDecoder_Decode2(TestImageProvider<Rgba32> provider)
|
|
{
|
|
using Image<Rgba32> image = provider.GetImage(CurDecoder.Instance);
|
|
CurFrameMetadata meta = image.Frames[0].Metadata.GetCurMetadata();
|
|
Assert.Equal(image.Width, meta.EncodingWidth.Value);
|
|
Assert.Equal(image.Height, meta.EncodingHeight.Value);
|
|
Assert.Equal(IconFrameCompression.Bmp, meta.Compression);
|
|
Assert.Equal(BmpBitsPerPixel.Bit32, meta.BmpBitsPerPixel);
|
|
}
|
|
}
|
|
|