//
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
//
namespace ImageSharp.Formats
{
using System.Collections.Generic;
///
/// Encapsulates the means to encode and decode bitmap images.
///
public class BmpFormat : IImageFormat
{
///
public string MimeType => "image/bmp";
///
public string Extension => "bmp";
///
public IEnumerable SupportedExtensions => new string[] { "bmp", "dip" };
///
public IImageDecoder Decoder => new BmpDecoder();
///
public IImageEncoder Encoder => new BmpEncoder();
///
public int HeaderSize => 2;
///
public bool IsSupportedFileFormat(byte[] header)
{
return header.Length >= this.HeaderSize &&
header[0] == 0x42 && // B
header[1] == 0x4D; // M
}
}
}