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.
29 lines
879 B
29 lines
879 B
// Copyright (c) Six Labors and contributors.
|
|
// Licensed under the Apache License, Version 2.0.
|
|
|
|
using System;
|
|
|
|
using SixLabors.ImageSharp.PixelFormats;
|
|
|
|
namespace SixLabors.ImageSharp.Tests
|
|
{
|
|
/// <summary>
|
|
/// Provides <see cref="Image{TPixel}" /> instances for parametric unit tests.
|
|
/// </summary>
|
|
/// <typeparam name="TPixel">The pixel format of the image</typeparam>
|
|
public abstract partial class TestImageProvider<TPixel>
|
|
where TPixel : struct, IPixel<TPixel>
|
|
{
|
|
private class LambdaProvider : TestImageProvider<TPixel>
|
|
{
|
|
private readonly Func<Image<TPixel>> factoryFunc;
|
|
|
|
public LambdaProvider(Func<Image<TPixel>> factoryFunc)
|
|
{
|
|
this.factoryFunc = factoryFunc;
|
|
}
|
|
|
|
public override Image<TPixel> GetImage() => this.factoryFunc();
|
|
}
|
|
}
|
|
}
|