Row operations over decoded image samples: unpacking packed components, scaling them to 8 bits, colour key and stencil coverage, Matte un-premultiplication and mask sampling. None of them allocates.
public static class ImageRows
ISO 32000-2 §8.9.3 (sample layout), §8.9.5.2 (Decode), §8.9.6 (masks), §11.6.5.2 (Matte). Each works on one row at a time, from its byte-aligned start, so the padding bits at the end of a row are never read as samples. Spans are the caller's: these methods keep nothing.
kind:method, kind:property, kind:ctor. Press Esc to clear.ColorKey(ReadOnlySpan<UInt16>, Int32, ReadOnlySpan<Double>, Span<Byte>)Computes colour key coverage for a row of raw samples: 0 where every component of a sample lies in its key range (masked out), 255 elsewhere (painted).MaskIndex(Int32, Int32, Int32)Returns the column (or row) of a mask that sample index of the base image falls on, by its centre.Stencil(ReadOnlySpan<Byte>, Int32, Boolean, Span<Byte>)Computes the coverage of a row of a stencil mask or explicit mask (1 bit per sample): 255 where the sample paints, 0 where it leaves the backdrop.Unpack(ReadOnlySpan<Byte>, Int32, Int32, Span<Byte>)Unpacks count components of a row stored at 1, 2, 4 or 8 bits into one byte each, as raw values.Unpack(ReadOnlySpan<Byte>, Int32, Int32, Span<UInt16>)Unpacks count components of a row stored at 1, 2, 4, 8 or 16 bits into one each, as raw values.UnpackScaled(ReadOnlySpan<Byte>, Int32, Int32, Int32, Span<Byte>)Unpacks a row and scales each component to 0-255: x × 255 / (2^n − 1), rounded, where n is the logical depth. The usual input to a byte colour conversion.Unpremultiply(Span<Single>, Int32, ReadOnlySpan<Single>, ReadOnlySpan<Single>, ReadOnlySpan<ComponentRange>)Undoes the pre-blending of colour against a matte colour (Matte): c = m + (c′ − m) / α, clamped to each component's range; a sample with α = 0 becomes the matte colour.