//
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
//
namespace ImageSharp.Formats
{
using System.IO;
///
/// Image encoder for writing image data to a stream in png format.
///
public class PngEncoder : IImageEncoder
{
///
public void Encode(Image image, Stream stream, IEncoderOptions options)
where TColor : struct, IPixel
{
IPngEncoderOptions pngOptions = PngEncoderOptions.Create(options);
this.Encode(image, stream, pngOptions);
}
///
/// Encodes the image to the specified stream from the .
///
/// The pixel format.
/// The to encode from.
/// The to encode the image data to.
/// The options for the encoder.
public void Encode(Image image, Stream stream, IPngEncoderOptions options)
where TColor : struct, IPixel
{
PngEncoderCore encode = new PngEncoderCore(options);
encode.Encode(image, stream);
}
}
}