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.
public static void UnpackScaled(ReadOnlySpan<byte> row, int storageBits, int bitsPerComponent, int count, Span<byte> destination)
The row, from its first byte.
The storage width: 1, 2, 4, 8 or 16.
The logical depth (BitsPerComponent), at most the storage width.
The number of components.
At least count bytes.
ISO 32000-2 §8.9.5.2: the default Decode maps 0 and 2^n − 1 onto the ends of the component's range.