DisplayImageSamples Struct

Definition

The samples of a DisplayImage at one resolution: the image's own, or a reduction of it by a power of two, decoded for a render that draws the image smaller than its resolution (GetSamplesAt(Int32)).

public readonly struct DisplayImageSamples : IEquatable<DisplayImageSamples>

Remarks

ISO 32000-2 §8.9.3 (the sample layout: rows top to bottom, samples left to right, components interleaved, each row starting on a byte boundary, 16-bit samples big-endian) and §8.9.4 (the image fills the unit square). A reduction by s = 2^Reduction of the image's SourceWidth × SourceHeight samples leaves ⌈W / s⌉ × ⌈H / s⌉, each standing for the s × s source samples it covers. Sample i therefore spans [i·s / W, (i + 1)·s / W) of the unit square, and the reduced samples together span [0, ⌈W / s⌉·s / W], clipped at 1: never infer the geometry from Width alone.

A value over samples the image or the document's image cache owns, so asking for an image's samples allocates nothing; two values are equal when they view the same samples. The default value views nothing and must not be read.

The samples are raw values like the image's (DecodeMapFor(DisplayImageSamples) gives the mapping that applies to them), averaged in the codec's own space, or the samples' own for an image decoded when its list was built, before any colour conversion. Immutable; safe to read from any number of threads. A backend may key a per-surface cache on the value (its samples are kept while anything holds them).

Tip: use kind:method, kind:property, kind:ctor. Press Esc to clear.

Properties (10)

Methods (4)

Operators (2)