//
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
//
namespace ImageSharp.Formats
{
///
/// Encapsulates the options for the .
///
public sealed class BmpEncoderOptions : EncoderOptions, IBmpEncoderOptions
{
///
/// Initializes a new instance of the class.
///
public BmpEncoderOptions()
{
}
///
/// Initializes a new instance of the class.
///
/// The options for the encoder.
private BmpEncoderOptions(IEncoderOptions options)
: base(options)
{
}
///
/// Gets or sets the number of bits per pixel.
///
public BmpBitsPerPixel BitsPerPixel { get; set; } = BmpBitsPerPixel.Pixel24;
///
/// Converts the options to a instance with a cast
/// or by creating a new instance with the specfied options.
///
/// The options for the encoder.
/// The options for the .
internal static IBmpEncoderOptions Create(IEncoderOptions options)
{
IBmpEncoderOptions bmpOptions = options as IBmpEncoderOptions;
if (bmpOptions != null)
{
return bmpOptions;
}
return new BmpEncoderOptions(options);
}
}
}