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.
35 lines
1.1 KiB
35 lines
1.1 KiB
// <copyright file="PadTest.cs" company="James Jackson-South">
|
|
// Copyright (c) James Jackson-South and contributors.
|
|
// Licensed under the Apache License, Version 2.0.
|
|
// </copyright>
|
|
|
|
namespace ImageSharp.Tests.Processing.Transforms
|
|
{
|
|
using ImageSharp.PixelFormats;
|
|
|
|
using Xunit;
|
|
|
|
public class PadTest : FileTestBase
|
|
{
|
|
[Theory]
|
|
[WithFileCollection(nameof(DefaultFiles), DefaultPixelType)]
|
|
public void ImageShouldPad<TPixel>(TestImageProvider<TPixel> provider)
|
|
where TPixel : struct, IPixel<TPixel>
|
|
{
|
|
using (Image<TPixel> image = provider.GetImage())
|
|
{
|
|
image.Pad(image.Width + 50, image.Height + 50)
|
|
.DebugSave(provider, null, Extensions.Bmp);
|
|
|
|
// Check pixels are empty
|
|
for (int y = 0; y < 25; y++)
|
|
{
|
|
for (int x = 0; x < 25; x++)
|
|
{
|
|
Assert.Equal(default(TPixel), image[x, y]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|