20 lines
404 B
C#
20 lines
404 B
C#
namespace NodePipeline.Application;
|
|
|
|
public struct ImageBuffer
|
|
{
|
|
public int Width;
|
|
public int Height;
|
|
public byte[] Pixels; // RGBARGBARGBA...
|
|
|
|
public readonly Span<byte> GetPixelSpan()
|
|
{
|
|
return Pixels.AsSpan();
|
|
}
|
|
|
|
public ImageBuffer(int width, int height)
|
|
{
|
|
Width = width;
|
|
Height = height;
|
|
Pixels = new byte[Width * Height * 4];
|
|
}
|
|
} |