Skip to main content

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

MemberSummary
NameWhat the format is called, in lower case, for a caller that shows it.

Methods

MemberSummary
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

NameTypeDescription
bytesReadOnlySpan<T><byte>The whole file.
limitsPictureLimitsWhat 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

NameTypeDescription
bytesReadOnlySpan<T><byte>The head of a file.

Returns booltrue when the file is worth trying to read.