TVecInt.BitUnpack Method

Overload List

#SignatureDescription
1function BitUnpack(const Src: TVecInt; const dstPrecision: TIntPrecision = prInt32): TVecInt; overload;Unpacks bit storage to specified integer storage.
2function BitUnpack(const Src: TMtxVecInt; const BitIndex: Int64; Index, Len: integer): TMtxVecInt; overload;Converts Src to unpacked bit storage.

Overload 1: function BitUnpack(const Src: TVecInt; const dstPrecision: TIntPrecision = prInt32): TVecInt; overload;

Unpacks bit storage to specified integer storage.

#NameTypeDescription
1SrcTVecIntsource TVecInt
2dstPrecisionTIntPrecision

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

Remarks:

Src holds packed bits and its precision must be prInt32. If bit [i] of Src is set, the integer (32, 16 or 8 bit) at index [i] in the calling vector is set to 1, otherwise to 0. The calling vector is sized to Src.BitCount values and its storage precision is set to dstPrecision. An exception is raised if Src.BitCount exceeds the largest possible Length of a vector.

Overload 2: 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.