mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-09-24 15:55:05 +00:00
Libraries
This change looks dramatic, but it's just separating out the already-split namespaces into separate top-level folders. In theory, every single one could be built into their own Nuget package. `SabreTools.Serialization` still builds the normal Nuget package that is used by all other projects and includes all namespaces.
This commit is contained in:
38
SabreTools.Data.Models/Bitmap/BITMAPFILEHEADER.cs
Normal file
38
SabreTools.Data.Models/Bitmap/BITMAPFILEHEADER.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Data.Models.Bitmap
|
||||
{
|
||||
/// <summary>
|
||||
/// The BITMAPFILEHEADER structure contains information about the type, size,
|
||||
/// and layout of a file that contains a DIB.
|
||||
/// </summary>
|
||||
/// <see href="https://learn.microsoft.com/en-us/windows/win32/api/wingdi/ns-wingdi-bitmapfileheader"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class BITMAPFILEHEADER
|
||||
{
|
||||
/// <summary>
|
||||
/// The file type; must be BM.
|
||||
/// </summary>
|
||||
public ushort Type;
|
||||
|
||||
/// <summary>
|
||||
/// The size, in bytes, of the bitmap file.
|
||||
/// </summary>
|
||||
public uint Size;
|
||||
|
||||
/// <summary>
|
||||
/// Reserved; must be zero.
|
||||
/// </summary>
|
||||
public ushort Reserved1;
|
||||
|
||||
/// <summary>
|
||||
/// Reserved; must be zero.
|
||||
/// </summary>
|
||||
public ushort Reserved2;
|
||||
|
||||
/// <summary>
|
||||
/// The offset, in bytes, from the beginning of the BITMAPFILEHEADER structure to the bitmap bits.
|
||||
/// </summary>
|
||||
public uint OffBits;
|
||||
}
|
||||
}
|
||||
97
SabreTools.Data.Models/Bitmap/BITMAPINFOHEADER.cs
Normal file
97
SabreTools.Data.Models/Bitmap/BITMAPINFOHEADER.cs
Normal file
@@ -0,0 +1,97 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Data.Models.Bitmap
|
||||
{
|
||||
/// <summary>
|
||||
/// The BITMAPINFOHEADER structure contains information about the dimensions and
|
||||
/// color format of a device-independent bitmap (DIB).
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class BITMAPINFOHEADER
|
||||
{
|
||||
/// <summary>
|
||||
/// Specifies the number of bytes required by the structure. This value does
|
||||
/// not include the size of the color table or the size of the color masks,
|
||||
/// if they are appended to the end of structure.
|
||||
/// </summary>
|
||||
public uint Size;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the width of the bitmap, in pixels.
|
||||
/// </summary>
|
||||
public int Width;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the height of the bitmap, in pixels.
|
||||
/// - For uncompressed RGB bitmaps, if biHeight is positive, the bitmap is a
|
||||
/// bottom-up DIB with the origin at the lower left corner. If biHeight is
|
||||
/// negative, the bitmap is a top-down DIB with the origin at the upper left
|
||||
/// corner.
|
||||
/// - For YUV bitmaps, the bitmap is always top-down, regardless of the sign of
|
||||
/// biHeight. Decoders should offer YUV formats with positive biHeight, but for
|
||||
/// backward compatibility they should accept YUV formats with either positive
|
||||
/// or negative biHeight.
|
||||
/// - For compressed formats, biHeight must be positive, regardless of image orientation.
|
||||
/// </summary>
|
||||
public int Height;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the number of planes for the target device. This value must be set to 1.
|
||||
/// </summary>
|
||||
public ushort Planes;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the number of bits per pixel (bpp). For uncompressed formats, this value
|
||||
/// is the average number of bits per pixel. For compressed formats, this value is the
|
||||
/// implied bit depth of the uncompressed image, after the image has been decoded.
|
||||
/// </summary>
|
||||
public ushort BitCount;
|
||||
|
||||
/// <summary>
|
||||
/// For compressed video and YUV formats, this member is a FOURCC code, specified as a
|
||||
/// DWORD in little-endian order. For example, YUYV video has the FOURCC 'VYUY' or
|
||||
/// 0x56595559. For more information, see FOURCC Codes.
|
||||
///
|
||||
/// For uncompressed RGB formats, the following values are possible:
|
||||
/// - BI_RGB: Uncompressed RGB.
|
||||
/// - BI_BITFIELDS: Uncompressed RGB with color masks. Valid for 16-bpp and 32-bpp bitmaps.
|
||||
///
|
||||
/// Note that BI_JPG and BI_PNG are not valid video formats.
|
||||
///
|
||||
/// For 16-bpp bitmaps, if biCompression equals BI_RGB, the format is always RGB 555.
|
||||
/// If biCompression equals BI_BITFIELDS, the format is either RGB 555 or RGB 565. Use
|
||||
/// the subtype GUID in the AM_MEDIA_TYPE structure to determine the specific RGB type.
|
||||
/// </summary>
|
||||
public uint Compression;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the size, in bytes, of the image. This can be set to 0 for uncompressed
|
||||
/// RGB bitmaps.
|
||||
/// </summary>
|
||||
public uint SizeImage;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the horizontal resolution, in pixels per meter, of the target device for
|
||||
/// the bitmap.
|
||||
/// </summary>
|
||||
public int XPelsPerMeter;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the vertical resolution, in pixels per meter, of the target device for
|
||||
/// the bitmap.
|
||||
/// </summary>
|
||||
public int YPelsPerMeter;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the number of color indices in the color table that are actually used by
|
||||
/// the bitmap.
|
||||
/// </summary>
|
||||
public uint ClrUsed;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the number of color indices that are considered important for displaying
|
||||
/// the bitmap. If this value is zero, all colors are important.
|
||||
/// </summary>
|
||||
public uint ClrImportant;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user