// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. using System; using SixLabors.ImageSharp.PixelFormats; namespace SixLabors.ImageSharp.Tests { /// /// Utility class to create specialized subclasses of generic classes (eg. ) /// Used as parameter for -based factory methods /// public class GenericFactory where TPixel : struct, IPixel { public virtual Image CreateImage(int width, int height) { return new Image(width, height); } public virtual Image CreateImage(byte[] bytes) { return Image.Load(bytes); } public virtual Image CreateImage(Image other) { return other.Clone(); } } }