Interface IRawImage
Represents a raw in-memory image with direct pixel data access. Contrast with encoded images (PNG, JPEG) — this is the decoded pixel buffer with known dimensions, stride, and format.
Inherited Members
Namespace: Zaya.Primitives
Assembly: Zaya.Primitives.dll
Syntax
public interface IRawImage : IDisposable
Properties
| Edit this page View SourceFormat
Gets the pixel format of the image.
Declaration
PixelFormat Format { get; }
Property Value
| Type | Description |
|---|---|
| PixelFormat |
Height
Gets the height of the image in pixels.
Declaration
int Height { get; }
Property Value
| Type | Description |
|---|---|
| int |
Stride
Gets the number of bytes per row (stride). May be larger than Width * BytesPerPixel due to memory alignment.
Declaration
int Stride { get; }
Property Value
| Type | Description |
|---|---|
| int |
Width
Gets the width of the image in pixels.
Declaration
int Width { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
| Edit this page View SourceGetPixelData()
Gets the raw pixel data as a read-only span. Direct access to the underlying buffer without additional allocations.
Declaration
ReadOnlySpan<byte> GetPixelData()
Returns
| Type | Description |
|---|---|
| ReadOnlySpan<byte> |
ToByteArray()
Creates a copy of the pixel data as a byte array. Useful when the data needs to outlive the frame instance.
Declaration
byte[] ToByteArray()
Returns
| Type | Description |
|---|---|
| byte[] | A new byte array containing a copy of the pixel data. |