//
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
//
namespace ImageSharp.Formats
{
using System;
using System.IO;
///
/// Image encoder for writing an image to a stream as a Windows bitmap.
///
/// The encoder can currently only write 24-bit rgb images to streams.
public class BmpEncoder : IImageEncoder
{
///
/// Gets or sets the number of bits per pixel.
///
public BmpBitsPerPixel BitsPerPixel { get; set; } = BmpBitsPerPixel.Pixel24;
///
public void Encode(Image image, Stream stream)
where TColor : struct, IPackedPixel, IEquatable
{
BmpEncoderCore encoder = new BmpEncoderCore();
encoder.Encode(image, stream, this.BitsPerPixel);
}
}
}