DisplayImage Class

Definition

An image interned in a display list: its samples, with the colour space and Decode mapping that give them meaning, shared by every paint of the same image XObject in the list. Never converted: a backend converts the samples to its device model.

public sealed class DisplayImage

Remarks

ISO 32000-2 §8.9.5 (image dictionaries: Width, Height, ColorSpace, BitsPerComponent, Decode, Interpolate), §8.9.7 (inline images, decoded once per paint) and §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). The image is painted into the unit square of user space (§8.9.4): image space maps to it through [1/Width 0 0 −1/Height 0 1], so the first row lands at the top, then through the transform set before the paint.

Fonts, images and colours are resolved before an operation enters the list, so a backend never reads the file. One instance per distinct image XObject per list: a backend may key a per-surface cache (a converted bitmap, a native image) on the instance. Immutable; safe to read from any number of threads.

Convert with list.Document.GetColorConverter(image.ColorSpace, conversion with { Target = … }, defaultColorSpaces), the raw samples first mapped through DecodeMap (for an Indexed image, MapToIndices(ReadOnlySpan<UInt16>, Span<Byte>, Int32)).

Most images are decoded when the list is built. An image whose codec decodes reduced resolutions (MaxReduction above 0; ImageHeader.MaxReduction) is instead kept encoded, its header read and its limits checked, and is decoded when it is drawn: GetSamplesAt(Int32) decodes it at the reduction asked for, once per reduction however many tiles ask at the same time, and the document's image cache keeps the result within its budget. A decode that fails then records its diagnostics on the document when the image is first drawn, not when the list is built, and the image paints nothing. A finer reduction already decoded serves a coarser request. The encoded data lives in the list, so a backend still never reads the file.

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

Properties (16)

Methods (5)