// // Copyright (c) James Jackson-South and contributors. // Licensed under the Apache License, Version 2.0. // namespace ImageSharp.Formats { using System; using System.IO; /// /// Encoder for generating an image out of a png encoded stream. /// /// /// At the moment the following features are supported: /// /// Filters: all filters are supported. /// /// /// Pixel formats: /// /// RGBA (True color) with alpha (8 bit). /// RGB (True color) without alpha (8 bit). /// Grayscale with alpha (8 bit). /// Grayscale without alpha (8 bit). /// Palette Index with alpha (8 bit). /// Palette Index without alpha (8 bit). /// /// /// public class PngDecoder : IImageDecoder { /// public void Decode(Image image, Stream stream, IDecoderOptions options) where TColor : struct, IPixel { IPngDecoderOptions pngOptions = PngDecoderOptions.Create(options); this.Decode(image, stream, pngOptions); } /// /// Decodes the image from the specified stream to the . /// /// The pixel format. /// The to decode to. /// The containing image data. /// The options for the decoder. public void Decode(Image image, Stream stream, IPngDecoderOptions options) where TColor : struct, IPixel { new PngDecoderCore(options).Decode(image, stream); } } }