// // Copyright (c) James Jackson-South and contributors. // Licensed under the Apache License, Version 2.0. // namespace ImageSharp.Tests { using System; using ImageSharp.PixelFormats; /// /// 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 new Image(other); } } }