2024-06-23 16:30:45 +02:00
|
|
|
namespace ServicePoint;
|
|
|
|
|
2024-10-19 14:21:50 +02:00
|
|
|
public sealed partial class BrightnessGrid
|
2024-06-23 16:30:45 +02:00
|
|
|
{
|
2024-10-19 16:04:01 +02:00
|
|
|
public static BrightnessGrid Load(nuint width, nuint height, Span<byte> bytes)
|
|
|
|
{
|
|
|
|
unsafe
|
|
|
|
{
|
|
|
|
fixed (byte* bytesPtr = bytes)
|
|
|
|
{
|
|
|
|
return Load(width, height, bytesPtr, (nuint)bytes.Length);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-10-16 20:56:55 +02:00
|
|
|
public byte this[nuint x, nuint y]
|
2024-06-23 16:30:45 +02:00
|
|
|
{
|
2024-10-19 14:21:50 +02:00
|
|
|
get => Get(x, y);
|
|
|
|
set => Set(x, y, value);
|
2024-06-23 16:30:45 +02:00
|
|
|
}
|
|
|
|
|
2024-10-19 14:21:50 +02:00
|
|
|
public Span<byte> Data => UnsafeDataRef().AsSpan();
|
2024-06-23 16:30:45 +02:00
|
|
|
}
|