mirror of https://github.com/SixLabors/ImageSharp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.2 KiB
38 lines
1.2 KiB
// <copyright file="BmpDecoder.cs" company="James Jackson-South">
|
|
// Copyright (c) James Jackson-South and contributors.
|
|
// Licensed under the Apache License, Version 2.0.
|
|
// </copyright>
|
|
|
|
namespace ImageSharp.Formats
|
|
{
|
|
using System;
|
|
using System.IO;
|
|
|
|
/// <summary>
|
|
/// Image decoder for generating an image out of a Windows bitmap stream.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Does not support the following formats at the moment:
|
|
/// <list type="bullet">
|
|
/// <item>JPG</item>
|
|
/// <item>PNG</item>
|
|
/// <item>RLE4</item>
|
|
/// <item>RLE8</item>
|
|
/// <item>BitFields</item>
|
|
/// </list>
|
|
/// Formats will be supported in a later releases. We advise always
|
|
/// to use only 24 Bit Windows bitmaps.
|
|
/// </remarks>
|
|
public class BmpDecoder : IImageDecoder
|
|
{
|
|
/// <inheritdoc/>
|
|
public void Decode<TColor>(Image<TColor> image, Stream stream, IDecoderOptions options)
|
|
where TColor : struct, IPixel<TColor>
|
|
{
|
|
Guard.NotNull(image, "image");
|
|
Guard.NotNull(stream, "stream");
|
|
|
|
new BmpDecoderCore().Decode(image, stream);
|
|
}
|
|
}
|
|
}
|
|
|