TAbstractMtxVecInt.BitUnpack Method

function BitUnpack(const Src: TMtxVecInt; const BitIndex: Int64; Index, Len: integer): TMtxVecInt; overload;

Converts Src to unpacked bit storage.

#NameTypeDescription
1SrcTMtxVecIntsource TVecInt or TMtxInt
2BitIndexInt64
3Indexintegerstart index
4Lenintegerelement count

Result: stored in self (calling object), returns self for chaining

Remarks:

Src holds packed bits and its precision must be prInt32. Bit b of Src is bit (b mod 32) of the Src value [b div 32]. If bit [BitIndex + i] of Src is set, the integer (32, 16 or 8 bit) at index [Index + i] in the calling vector is set to 1, otherwise to 0. Returns the result of bit unpacking the Src bits [BitIndex]..[BitIndex + Len - 1] stored in the calling object (Self) values [Index]..[Index+Len-1]. BitIndex is a bit index, counted from bit 0 of the Src value [0]. Index is an index of the calling object values. The Len parameter specifies the number of bits that will be unpacked from Src. The storage precision and the size of the calling object are preserved. An exception is raised if ConditionCheck is True and the bits [BitIndex]..[BitIndex + Len - 1] are not within the 32*Src.Length bits of Src, or if the values [Index]..[Index+Len-1] are not within the calling object.