|
|
|
@ -13,35 +13,43 @@ namespace SixLabors.ImageSharp.Formats.Bmp |
|
|
|
/// All of the other integer values are stored in little-endian format
|
|
|
|
/// (i.e. least-significant byte first).
|
|
|
|
/// </remarks>
|
|
|
|
internal sealed class BmpFileHeader |
|
|
|
internal readonly struct BmpFileHeader |
|
|
|
{ |
|
|
|
/// <summary>
|
|
|
|
/// Defines of the data structure in the bitmap file.
|
|
|
|
/// </summary>
|
|
|
|
public const int Size = 14; |
|
|
|
|
|
|
|
public BmpFileHeader(short type, int fileSize, int reserved, int offset) |
|
|
|
{ |
|
|
|
this.Type = type; |
|
|
|
this.FileSize = fileSize; |
|
|
|
this.Reserved = reserved; |
|
|
|
this.Offset = offset; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets the Bitmap identifier.
|
|
|
|
/// Gets the Bitmap identifier.
|
|
|
|
/// The field used to identify the bitmap file: 0x42 0x4D
|
|
|
|
/// (Hex code points for B and M)
|
|
|
|
/// </summary>
|
|
|
|
public short Type { get; set; } |
|
|
|
public short Type { get; } |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets the size of the bitmap file in bytes.
|
|
|
|
/// Gets the size of the bitmap file in bytes.
|
|
|
|
/// </summary>
|
|
|
|
public int FileSize { get; set; } |
|
|
|
public int FileSize { get; } |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets any reserved data; actual value depends on the application
|
|
|
|
/// Gets any reserved data; actual value depends on the application
|
|
|
|
/// that creates the image.
|
|
|
|
/// </summary>
|
|
|
|
public int Reserved { get; set; } |
|
|
|
public int Reserved { get; } |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets the offset, i.e. starting address, of the byte where
|
|
|
|
/// Gets the offset, i.e. starting address, of the byte where
|
|
|
|
/// the bitmap data can be found.
|
|
|
|
/// </summary>
|
|
|
|
public int Offset { get; set; } |
|
|
|
public int Offset { get; } |
|
|
|
} |
|
|
|
} |
|
|
|
} |