mirror of
https://gitlab.com/Syroot/Worms.git
synced 2025-04-09 19:00:06 +03:00
Use RawBitmap as image data container everywhere.
This commit is contained in:
parent
077669b81c
commit
a16d0a5146
@ -81,7 +81,7 @@ namespace Syroot.Worms.Armageddon
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the team grave bitmap if it uses a custom one.
|
/// Gets or sets the team grave bitmap if it uses a custom one.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public RawBitmapData Grave { get; set; }
|
public RawBitmap Grave { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the team's special weapon.
|
/// Gets or sets the team's special weapon.
|
||||||
@ -151,7 +151,7 @@ namespace Syroot.Worms.Armageddon
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the bitmap of the team flag.
|
/// Gets or sets the bitmap of the team flag.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public RawBitmapData Flag { get; set; }
|
public RawBitmap Flag { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the deathmatch rank this team reached.
|
/// Gets or sets the deathmatch rank this team reached.
|
||||||
@ -210,7 +210,7 @@ namespace Syroot.Worms.Armageddon
|
|||||||
if (GraveSprite < 0)
|
if (GraveSprite < 0)
|
||||||
{
|
{
|
||||||
GraveFileName = reader.ReadString(0x20);
|
GraveFileName = reader.ReadString(0x20);
|
||||||
Grave = new RawBitmapData()
|
Grave = new RawBitmap()
|
||||||
{
|
{
|
||||||
BitsPerPixel = 8,
|
BitsPerPixel = 8,
|
||||||
Size = new Size(24, 32),
|
Size = new Size(24, 32),
|
||||||
@ -233,7 +233,7 @@ namespace Syroot.Worms.Armageddon
|
|||||||
MissionStatuses = reader.ReadStructs<TeamMissionStatus>(_missionCount);
|
MissionStatuses = reader.ReadStructs<TeamMissionStatus>(_missionCount);
|
||||||
|
|
||||||
FlagFileName = reader.ReadString(0x20);
|
FlagFileName = reader.ReadString(0x20);
|
||||||
Flag = new RawBitmapData()
|
Flag = new RawBitmap()
|
||||||
{
|
{
|
||||||
BitsPerPixel = 8,
|
BitsPerPixel = 8,
|
||||||
Size = new Size(20, 17),
|
Size = new Size(20, 17),
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using Syroot.BinaryData;
|
using Syroot.BinaryData;
|
||||||
using Syroot.Worms.Core.Graphics;
|
using Syroot.Worms.Core;
|
||||||
|
|
||||||
namespace Syroot.Worms.Mgame
|
namespace Syroot.Worms.Mgame
|
||||||
{
|
{
|
||||||
@ -93,11 +93,12 @@ namespace Syroot.Worms.Mgame
|
|||||||
// Decompress the data.
|
// Decompress the data.
|
||||||
int dataSize = stream.ReadInt32();
|
int dataSize = stream.ReadInt32();
|
||||||
int dataSizeCompressed = stream.ReadInt32();
|
int dataSizeCompressed = stream.ReadInt32();
|
||||||
byte[] data = Decompress(stream, dataSizeCompressed, dataSize);
|
image.RawBitmap = new RawBitmap
|
||||||
// The actual image width is a multiple of 4.
|
{
|
||||||
image.Bitmap = BitmapTools.CreateIndexed(new Size((image.Size.Width + 4 - 1) / 4 * 4, image.Size.Height),
|
Size = new Size(Algebra.NextMultiple(image.Size.Width, 4), image.Size.Height),
|
||||||
palette, data);
|
Palette = palette,
|
||||||
|
Data = Decompress(stream, dataSizeCompressed, dataSize)
|
||||||
|
};
|
||||||
Images.Add(image);
|
Images.Add(image);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,6 @@ namespace Syroot.Worms.Mgame
|
|||||||
public int UnknownC { get; set; }
|
public int UnknownC { get; set; }
|
||||||
public Size Size { get; set; }
|
public Size Size { get; set; }
|
||||||
public Point Center { get; set; }
|
public Point Center { get; set; }
|
||||||
public Bitmap Bitmap { get; set; }
|
public RawBitmap RawBitmap { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using Syroot.BinaryData;
|
using Syroot.BinaryData;
|
||||||
using Syroot.Worms.Core.Graphics;
|
|
||||||
|
|
||||||
namespace Syroot.Worms.Mgame
|
namespace Syroot.Worms.Mgame
|
||||||
{
|
{
|
||||||
@ -95,7 +94,14 @@ namespace Syroot.Worms.Mgame
|
|||||||
int dataLength = offsets[i + 1] - offset;
|
int dataLength = offsets[i + 1] - offset;
|
||||||
Size size = sizes[i];
|
Size size = sizes[i];
|
||||||
if (!size.IsEmpty)
|
if (!size.IsEmpty)
|
||||||
images[i].Bitmap = BitmapTools.CreateIndexed(size, palette.Colors, stream.ReadBytes(dataLength));
|
{
|
||||||
|
images[i].RawBitmap = new RawBitmap
|
||||||
|
{
|
||||||
|
Size = size,
|
||||||
|
Palette = palette.Colors,
|
||||||
|
Data = stream.ReadBytes(dataLength)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
Images.Add(images[i]);
|
Images.Add(images[i]);
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,6 @@ namespace Syroot.Worms.Mgame
|
|||||||
// ---- PROPERTIES ---------------------------------------------------------------------------------------------
|
// ---- PROPERTIES ---------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
public Point Center { get; set; }
|
public Point Center { get; set; }
|
||||||
public Bitmap Bitmap { get; set; }
|
public RawBitmap RawBitmap { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -36,7 +36,7 @@ namespace Syroot.Worms.Scratchpad
|
|||||||
{
|
{
|
||||||
string pngFileName = Path.ChangeExtension(i.ToString(), "png");
|
string pngFileName = Path.ChangeExtension(i.ToString(), "png");
|
||||||
IgdImage image = igd.Images[i];
|
IgdImage image = igd.Images[i];
|
||||||
image.Bitmap.Save(Path.Combine(pngIgdFolder, pngFileName), ImageFormat.Png);
|
image.RawBitmap.ToBitmap().Save(Path.Combine(pngIgdFolder, pngFileName), ImageFormat.Png);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -65,7 +65,7 @@ namespace Syroot.Worms.Scratchpad
|
|||||||
for (int i = 0; i < ksf.Images.Count; i++)
|
for (int i = 0; i < ksf.Images.Count; i++)
|
||||||
{
|
{
|
||||||
string pngFileName = Path.ChangeExtension(i.ToString(), "png");
|
string pngFileName = Path.ChangeExtension(i.ToString(), "png");
|
||||||
ksf.Images[i].Bitmap?.Save(Path.Combine(pngKsfFolder, pngFileName), ImageFormat.Png);
|
ksf.Images[i].RawBitmap?.ToBitmap().Save(Path.Combine(pngKsfFolder, pngFileName), ImageFormat.Png);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ namespace Syroot.Worms.WorldParty
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the team grave bitmap if it uses a custom one.
|
/// Gets or sets the team grave bitmap if it uses a custom one.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public RawBitmapData Grave { get; set; }
|
public RawBitmap Grave { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the team's special weapon.
|
/// Gets or sets the team's special weapon.
|
||||||
@ -149,7 +149,7 @@ namespace Syroot.Worms.WorldParty
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the bitmap of the team flag.
|
/// Gets or sets the bitmap of the team flag.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public RawBitmapData Flag { get; set; }
|
public RawBitmap Flag { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets an unknown value.
|
/// Gets or sets an unknown value.
|
||||||
@ -209,7 +209,7 @@ namespace Syroot.Worms.WorldParty
|
|||||||
if (GraveSprite < 0)
|
if (GraveSprite < 0)
|
||||||
{
|
{
|
||||||
GraveFileName = reader.ReadString(0x20);
|
GraveFileName = reader.ReadString(0x20);
|
||||||
Grave = new RawBitmapData()
|
Grave = new RawBitmap()
|
||||||
{
|
{
|
||||||
BitsPerPixel = 8,
|
BitsPerPixel = 8,
|
||||||
Size = new Size(24, 32),
|
Size = new Size(24, 32),
|
||||||
@ -232,7 +232,7 @@ namespace Syroot.Worms.WorldParty
|
|||||||
MissionStatuses = reader.ReadStructs<TeamMissionStatus>(_missionCount);
|
MissionStatuses = reader.ReadStructs<TeamMissionStatus>(_missionCount);
|
||||||
|
|
||||||
FlagFileName = reader.ReadString(0x20);
|
FlagFileName = reader.ReadString(0x20);
|
||||||
Flag = new RawBitmapData()
|
Flag = new RawBitmap()
|
||||||
{
|
{
|
||||||
BitsPerPixel = 8,
|
BitsPerPixel = 8,
|
||||||
Size = new Size(20, 17),
|
Size = new Size(20, 17),
|
||||||
|
16
src/Syroot.Worms/Core/Algebra.cs
Normal file
16
src/Syroot.Worms/Core/Algebra.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
namespace Syroot.Worms.Core
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Represents mathemtical helper utilities.
|
||||||
|
/// </summary>
|
||||||
|
public static class Algebra
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the nearest, bigger <paramref name="multiple"/> of the given <paramref name="value"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value">The value whose nearest, bigger multiple will be returned of.</param>
|
||||||
|
/// <param name="multiple">The multiple to return.</param>
|
||||||
|
/// <returns>The nearest, bigger multiple.</returns>
|
||||||
|
public static int NextMultiple(int value, int multiple) => (value + multiple - 1) / multiple * multiple;
|
||||||
|
}
|
||||||
|
}
|
@ -15,10 +15,7 @@ namespace Syroot.Worms.Core
|
|||||||
/// <param name="self">The extended <see cref="Byte"/> instance.</param>
|
/// <param name="self">The extended <see cref="Byte"/> instance.</param>
|
||||||
/// <param name="index">The 0-based index of the bit to enable.</param>
|
/// <param name="index">The 0-based index of the bit to enable.</param>
|
||||||
/// <returns>The current byte with the bit enabled.</returns>
|
/// <returns>The current byte with the bit enabled.</returns>
|
||||||
public static byte EnableBit(this byte self, int index)
|
public static byte EnableBit(this byte self, int index) => (byte)(self | (1 << index));
|
||||||
{
|
|
||||||
return (byte)(self | (1 << index));
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the current byte with the bit at the <paramref name="index"/> cleared (being 0).
|
/// Returns the current byte with the bit at the <paramref name="index"/> cleared (being 0).
|
||||||
@ -26,10 +23,7 @@ namespace Syroot.Worms.Core
|
|||||||
/// <param name="self">The extended <see cref="Byte"/> instance.</param>
|
/// <param name="self">The extended <see cref="Byte"/> instance.</param>
|
||||||
/// <param name="index">The 0-based index of the bit to disable.</param>
|
/// <param name="index">The 0-based index of the bit to disable.</param>
|
||||||
/// <returns>The current byte with the bit disabled.</returns>
|
/// <returns>The current byte with the bit disabled.</returns>
|
||||||
public static byte DisableBit(this byte self, int index)
|
public static byte DisableBit(this byte self, int index) => (byte)(self & ~(1 << index));
|
||||||
{
|
|
||||||
return (byte)(self & ~(1 << index));
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns a value indicating whether the bit at the <paramref name="index"/> in the current byte is enabled
|
/// Returns a value indicating whether the bit at the <paramref name="index"/> in the current byte is enabled
|
||||||
@ -38,10 +32,7 @@ namespace Syroot.Worms.Core
|
|||||||
/// <param name="self">The extended <see cref="Byte"/> instance.</param>
|
/// <param name="self">The extended <see cref="Byte"/> instance.</param>
|
||||||
/// <param name="index">The 0-based index of the bit to check.</param>
|
/// <param name="index">The 0-based index of the bit to check.</param>
|
||||||
/// <returns><c>true</c> when the bit is set; otherwise <c>false</c>.</returns>
|
/// <returns><c>true</c> when the bit is set; otherwise <c>false</c>.</returns>
|
||||||
public static bool GetBit(this byte self, int index)
|
public static bool GetBit(this byte self, int index) => (self & (1 << index)) != 0;
|
||||||
{
|
|
||||||
return (self & (1 << index)) != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the current byte with all bits rotated in the given <paramref name="direction"/>, where positive
|
/// Returns the current byte with all bits rotated in the given <paramref name="direction"/>, where positive
|
||||||
@ -97,10 +88,7 @@ namespace Syroot.Worms.Core
|
|||||||
/// <param name="bits">The number of least significant bits which are used to store the <see cref="Byte"/>
|
/// <param name="bits">The number of least significant bits which are used to store the <see cref="Byte"/>
|
||||||
/// value.</param>
|
/// value.</param>
|
||||||
/// <returns>The decoded <see cref="Byte"/>.</returns>
|
/// <returns>The decoded <see cref="Byte"/>.</returns>
|
||||||
public static byte DecodeByte(this byte self, int bits)
|
public static byte DecodeByte(this byte self, int bits) => DecodeByte(self, bits, 0);
|
||||||
{
|
|
||||||
return DecodeByte(self, bits, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns an <see cref="Byte"/> instance represented by the given number of <paramref name="bits"/>, starting
|
/// Returns an <see cref="Byte"/> instance represented by the given number of <paramref name="bits"/>, starting
|
||||||
@ -124,10 +112,7 @@ namespace Syroot.Worms.Core
|
|||||||
/// <param name="bits">The number of least significant bits which are used to store the <see cref="SByte"/>
|
/// <param name="bits">The number of least significant bits which are used to store the <see cref="SByte"/>
|
||||||
/// value.</param>
|
/// value.</param>
|
||||||
/// <returns>The decoded <see cref="SByte"/>.</returns>
|
/// <returns>The decoded <see cref="SByte"/>.</returns>
|
||||||
public static sbyte DecodeSByte(this byte self, int bits)
|
public static sbyte DecodeSByte(this byte self, int bits) => DecodeSByte(self, bits, 0);
|
||||||
{
|
|
||||||
return DecodeSByte(self, bits, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns an <see cref="SByte"/> instance represented by the given number of <paramref name="bits"/>, starting
|
/// Returns an <see cref="SByte"/> instance represented by the given number of <paramref name="bits"/>, starting
|
||||||
@ -154,10 +139,7 @@ namespace Syroot.Worms.Core
|
|||||||
/// <param name="value">The value to encode.</param>
|
/// <param name="value">The value to encode.</param>
|
||||||
/// <param name="bits">The number of bits which are used to store the <see cref="Byte"/> value.</param>
|
/// <param name="bits">The number of bits which are used to store the <see cref="Byte"/> value.</param>
|
||||||
/// <returns>The current byte with the value encoded into it.</returns>
|
/// <returns>The current byte with the value encoded into it.</returns>
|
||||||
public static byte Encode(this byte self, byte value, int bits)
|
public static byte Encode(this byte self, byte value, int bits) => Encode(self, value, bits, 0);
|
||||||
{
|
|
||||||
return Encode(self, value, bits, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the current byte with the given <paramref name="value"/> set into the given number of
|
/// Returns the current byte with the given <paramref name="value"/> set into the given number of
|
||||||
@ -187,10 +169,7 @@ namespace Syroot.Worms.Core
|
|||||||
/// <param name="value">The value to encode.</param>
|
/// <param name="value">The value to encode.</param>
|
||||||
/// <param name="bits">The number of bits which are used to store the <see cref="SByte"/> value.</param>
|
/// <param name="bits">The number of bits which are used to store the <see cref="SByte"/> value.</param>
|
||||||
/// <returns>The current byte with the value encoded into it.</returns>
|
/// <returns>The current byte with the value encoded into it.</returns>
|
||||||
public static byte Encode(this byte self, sbyte value, int bits)
|
public static byte Encode(this byte self, sbyte value, int bits) => Encode(self, value, bits, 0);
|
||||||
{
|
|
||||||
return Encode(self, value, bits, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the current byte with the given <paramref name="value"/> set into the given number of
|
/// Returns the current byte with the given <paramref name="value"/> set into the given number of
|
||||||
|
64
src/Syroot.Worms/Core/Graphics/RawBitmap.cs
Normal file
64
src/Syroot.Worms/Core/Graphics/RawBitmap.cs
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Drawing.Imaging;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using Syroot.Worms.Core;
|
||||||
|
|
||||||
|
namespace Syroot.Worms
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Represents a pixel-based 2D image in different color formats.
|
||||||
|
/// </summary>
|
||||||
|
public class RawBitmap
|
||||||
|
{
|
||||||
|
// ---- PROPERTIES ---------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the number of bits required to describe a color per pixel.
|
||||||
|
/// </summary>
|
||||||
|
public byte BitsPerPixel { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the colors in the palette of the bitmap, if it has one.
|
||||||
|
/// </summary>
|
||||||
|
public IList<Color> Palette { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the size of the image in pixels.
|
||||||
|
/// </summary>
|
||||||
|
public Size Size { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the data of the image pixels.
|
||||||
|
/// </summary>
|
||||||
|
public byte[] Data { get; set; }
|
||||||
|
|
||||||
|
// ---- METHODS (PUBLIC) ---------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a <see cref="Bitmap"/> from the raw data.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The <see cref="Bitmap"/> created from the raw data.</returns>
|
||||||
|
public Bitmap ToBitmap()
|
||||||
|
{
|
||||||
|
using (DisposableGCHandle dataPin = new DisposableGCHandle(Data, GCHandleType.Pinned))
|
||||||
|
{
|
||||||
|
// Transfer the pixel data, respecting power-of-2 strides.
|
||||||
|
Bitmap bitmap = new Bitmap(Size.Width, Size.Height, PixelFormat.Format8bppIndexed);
|
||||||
|
BitmapData bitmapData = bitmap.LockBits(new Rectangle(0, 0, Size.Width, Size.Height),
|
||||||
|
ImageLockMode.WriteOnly, PixelFormat.Format8bppIndexed);
|
||||||
|
for (int y = 0; y < Size.Height; y++)
|
||||||
|
Marshal.Copy(Data, y * Size.Width, bitmapData.Scan0 + y * bitmapData.Stride, Size.Width);
|
||||||
|
bitmap.UnlockBits(bitmapData);
|
||||||
|
|
||||||
|
// Transfer the palette.
|
||||||
|
ColorPalette bitmapPalette = bitmap.Palette;
|
||||||
|
for (int i = 0; i < Palette.Count; i++)
|
||||||
|
bitmapPalette.Entries[i] = Palette[i];
|
||||||
|
bitmap.Palette = bitmapPalette;
|
||||||
|
|
||||||
|
return bitmap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -12,7 +12,7 @@ namespace Syroot.Worms
|
|||||||
/// Represents a (palettized) graphical image stored in an IMG file, possibly compressed.
|
/// Represents a (palettized) graphical image stored in an IMG file, possibly compressed.
|
||||||
/// Used by W2, WA and WWP. S. https://worms2d.info/Image_file.
|
/// Used by W2, WA and WWP. S. https://worms2d.info/Image_file.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class Img : RawBitmapData, ILoadableFile, ISaveableFile
|
public class Img : RawBitmap, ILoadableFile, ISaveableFile
|
||||||
{
|
{
|
||||||
// ---- CONSTANTS ----------------------------------------------------------------------------------------------
|
// ---- CONSTANTS ----------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -203,8 +203,8 @@ namespace Syroot.Worms
|
|||||||
// Write the image palette if available. The first color of the palette is implicitly black.
|
// Write the image palette if available. The first color of the palette is implicitly black.
|
||||||
if (Palette != null)
|
if (Palette != null)
|
||||||
{
|
{
|
||||||
writer.Write((short)(Palette.Length - 1));
|
writer.Write((short)(Palette.Count - 1));
|
||||||
for (int i = 1; i < Palette.Length; i++)
|
for (int i = 1; i < Palette.Count; i++)
|
||||||
{
|
{
|
||||||
Color color = Palette[i];
|
Color color = Palette[i];
|
||||||
writer.Write(color.R);
|
writer.Write(color.R);
|
||||||
|
@ -1,32 +0,0 @@
|
|||||||
using System.Drawing;
|
|
||||||
|
|
||||||
namespace Syroot.Worms
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Represents a pixel-based 2D image in different color formats.
|
|
||||||
/// </summary>
|
|
||||||
public class RawBitmapData
|
|
||||||
{
|
|
||||||
// ---- PROPERTIES ---------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the number of bits required to describe a color per pixel.
|
|
||||||
/// </summary>
|
|
||||||
public byte BitsPerPixel { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the colors in the palette of the bitmap, if it has one.
|
|
||||||
/// </summary>
|
|
||||||
public Color[] Palette { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the size of the image in pixels.
|
|
||||||
/// </summary>
|
|
||||||
public Size Size { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the data of the image pixels.
|
|
||||||
/// </summary>
|
|
||||||
public byte[] Data { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user