servicepoint/crates/servicepoint_binding_cs/ServicePoint/Bitmap.cs
2024-10-20 13:31:41 +02:00

24 lines
508 B
C#

namespace ServicePoint;
public sealed partial class Bitmap
{
public static Bitmap Load(nuint width, nuint height, ReadOnlySpan<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();
}