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.
public static void Stencil(ReadOnlySpan<byte> row, int width, bool inverted, Span<byte> coverage)
The packed row.
The number of samples.
Whether the mask's Decode array is [1 0] (combined with SamplesInverted; see
IsInverted): then a sample 1 paints. Otherwise a sample 0 paints.
One byte per sample.
ISO 32000-2 §8.9.6.2 and §8.9.6.3.