Skip to main content

PictureLimits struct

Namespace: Arlecchino.Pictures · Assembly: Arlecchino.Pictures

What a caller will hold, and what it has a use for. A format that can read itself at a smaller size does so rather than decoding pixels that will never be drawn.

public readonly struct PictureLimits : IEquatable<PictureLimits>

Implements IEquatable<T><PictureLimits>

Constructors

MemberSummary
PictureLimits(int, int)What a caller will hold, and what it has a use for. A format that can read itself at a smaller size does so rather than decoding pixels that will never be drawn.

Properties

MemberSummary
DefaultWhat a caller gets by asking for nothing in particular: the whole picture, within reason.
EnoughPixelsHow many pixels the caller has a use for, or nought for as many as the picture holds. A decoder answers with at least this many where it can; the size it lands on is its own.
MostPixelsHow many pixels may be held at once, refusing anything larger.

Methods

MemberSummary
Deconstruct(out int, out int)
For(int)Limits for a caller that will draw the picture no larger than a given number of pixels.

Constructors in detail

PictureLimits(int, int)

public PictureLimits(int MostPixels, int EnoughPixels);

What a caller will hold, and what it has a use for. A format that can read itself at a smaller size does so rather than decoding pixels that will never be drawn.

Parameters

NameTypeDescription
MostPixelsintHow many pixels may be held at once, refusing anything larger.
EnoughPixelsintHow many pixels the caller has a use for, or nought for as many as the picture holds. A decoder answers with at least this many where it can; the size it lands on is its own.

Properties in detail

Default

public static PictureLimits Default { get; }

What a caller gets by asking for nothing in particular: the whole picture, within reason.

Type PictureLimits

EnoughPixels

public int EnoughPixels { get; init; }

How many pixels the caller has a use for, or nought for as many as the picture holds. A decoder answers with at least this many where it can; the size it lands on is its own.

Type int

MostPixels

public int MostPixels { get; init; }

How many pixels may be held at once, refusing anything larger.

Type int

Methods in detail

Deconstruct(out int, out int)

public void Deconstruct(out int MostPixels, out int EnoughPixels);

Parameters

NameTypeDescription
MostPixelsint
EnoughPixelsint

For(int)

public static PictureLimits For(int pixels);

Limits for a caller that will draw the picture no larger than a given number of pixels.

Parameters

NameTypeDescription
pixelsintHow many pixels the caller has a use for.

Returns PictureLimits — The limits.