ColorKey(ReadOnlySpan, Int32, ReadOnlySpan, Span) Method

Definition

Assembly Broadside.dll

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).

public static void ColorKey(ReadOnlySpan<ushort> raw, int components, ReadOnlySpan<double> ranges, Span<byte> coverage)

Parameters

raw
ReadOnlySpan<UInt16>

Raw components, interleaved: width × components values (from Unpack(ReadOnlySpan<Byte>, Int32, Int32, Span<UInt16>)).

components
Int32

The number of components per sample.

ranges
ReadOnlySpan<Double>

The key ranges, min and max per component (ColorKey).

coverage
Span<Byte>

One byte per sample.

Remarks

ISO 32000-2 §8.9.6.4: the comparison is on the raw sample values, before the Decode array is applied, and a sample is masked only when all of its components are in range.