mirror of https://github.com/SixLabors/ImageSharp
4 changed files with 54 additions and 17 deletions
@ -1,26 +1,38 @@ |
|||||
// <copyright file="BmpEncoderTests.cs" company="James Jackson-South">
|
// Copyright (c) Six Labors and contributors.
|
||||
// Copyright (c) James Jackson-South and contributors.
|
|
||||
// Licensed under the Apache License, Version 2.0.
|
// Licensed under the Apache License, Version 2.0.
|
||||
// </copyright>
|
|
||||
|
|
||||
using ImageSharp.Formats; |
using SixLabors.ImageSharp.Formats; |
||||
|
using SixLabors.ImageSharp.PixelFormats; |
||||
|
using Xunit; |
||||
|
// ReSharper disable InconsistentNaming
|
||||
|
|
||||
namespace ImageSharp.Tests |
namespace SixLabors.ImageSharp.Tests |
||||
{ |
{ |
||||
using ImageSharp.PixelFormats; |
using SixLabors.ImageSharp.Formats.Bmp; |
||||
|
|
||||
using Xunit; |
|
||||
|
|
||||
public class BmpDecoderTests : FileTestBase |
public class BmpDecoderTests : FileTestBase |
||||
{ |
{ |
||||
[Theory] |
[Theory] |
||||
[WithFileCollection(nameof(AllBmpFiles), PixelTypes.Rgb24)] |
[WithFileCollection(nameof(AllBmpFiles), PixelTypes.Rgb24)] |
||||
public void OpenAllBmpFiles_SaveBmp<TPixel>(TestImageProvider<TPixel> provider) |
public void DecodeBmp<TPixel>(TestImageProvider<TPixel> provider) |
||||
|
where TPixel : struct, IPixel<TPixel> |
||||
|
{ |
||||
|
using (Image<TPixel> image = provider.GetImage(new BmpDecoder())) |
||||
|
{ |
||||
|
image.DebugSave(provider, "bmp"); |
||||
|
image.CompareToOriginal(provider); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
[Theory] |
||||
|
[WithFile(TestImages.Bmp.F, CommonNonDefaultPixelTypes)] |
||||
|
public void BmpDecoder_IsNotBoundToSinglePixelType<TPixel>(TestImageProvider<TPixel> provider) |
||||
where TPixel : struct, IPixel<TPixel> |
where TPixel : struct, IPixel<TPixel> |
||||
{ |
{ |
||||
using (Image<TPixel> image = provider.GetImage()) |
using (Image<TPixel> image = provider.GetImage(new BmpDecoder())) |
||||
{ |
{ |
||||
provider.Utility.SaveTestOutputFile(image, "bmp"); |
image.DebugSave(provider, "bmp"); |
||||
|
image.CompareToOriginal(provider); |
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
|
|||||
Loading…
Reference in new issue