mirror of
https://github.com/cccb/servicepoint.git
synced 2025-01-19 02:20:12 +01:00
24 lines
500 B
C#
24 lines
500 B
C#
namespace ServicePoint;
|
|
|
|
public sealed partial class Bitmap
|
|
{
|
|
public static Bitmap Load(nuint width, nuint height, Span<byte> bytes)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (byte* bytesPtr = bytes)
|
|
{
|
|
return Load(width, height, bytesPtr, (nuint)bytes.Length);
|
|
}
|
|
}
|
|
}
|
|
|
|
public bool this[nuint x, nuint y]
|
|
{
|
|
get => Get(x, y);
|
|
set => Set(x, y, value);
|
|
}
|
|
|
|
public Span<byte> Data => UnsafeDataRef().AsSpan();
|
|
}
|