UnpackScaled(ReadOnlySpan, Int32, Int32, Int32, Span) Method

Definition

Assembly Broadside.dll

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)

Parameters

row
ReadOnlySpan<Byte>

The row, from its first byte.

storageBits
Int32

The storage width: 1, 2, 4, 8 or 16.

bitsPerComponent
Int32

The logical depth (BitsPerComponent), at most the storage width.

count
Int32

The number of components.

destination
Span<Byte>

At least count bytes.

Remarks

ISO 32000-2 §8.9.5.2: the default Decode maps 0 and 2^n − 1 onto the ends of the component's range.