IPictureFormat interface
Namespace: Arlecchino.Pictures · Assembly: Arlecchino.Pictures
One picture format. It claims a file by the head of it and reads the whole of one into pixels, answering null rather than throwing.
public interface IPictureFormat
Implemented by Bmp, Jpeg, Png, Pnm, Qoi, Tga
Properties
| Member | Summary |
|---|---|
Name | What the format is called, in lower case, for a caller that shows it. |
Methods
| Member | Summary |
|---|---|
Read(ReadOnlySpan<byte>, PictureLimits) | Reads the picture. |
Starts(ReadOnlySpan<byte>) | Whether the bytes begin the way this format does. |
Properties in detail
Name
public string Name { get; }
What the format is called, in lower case, for a caller that shows it.
Type string
Methods in detail
Read(ReadOnlySpan<byte>, PictureLimits)
public Raster? Read(ReadOnlySpan<byte> bytes, PictureLimits limits);
Reads the picture.
Parameters
| Name | Type | Description |
|---|---|---|
bytes | ReadOnlySpan<T><byte> | The whole file. |
limits | PictureLimits | What the caller will hold and what it has a use for. |
Returns Raster — The pixels, or null when this is not a file of this format that can be read.
Starts(ReadOnlySpan<byte>)
public bool Starts(ReadOnlySpan<byte> bytes);
Whether the bytes begin the way this format does.
Parameters
| Name | Type | Description |
|---|---|---|
bytes | ReadOnlySpan<T><byte> | The head of a file. |
Returns bool — true when the file is worth trying to read.