imap_processing.idex.decode.read_bits#

imap_processing.idex.decode.read_bits(bits: str, bit_pointer: int, read_num: int, signed: bool = False) tuple[int, int]#

Read bits from a binary string and convert to an int.

Parameters:
  • bits (str) – Binary string to read from.

  • bit_pointer (int) – Current position in binary string.

  • read_num (int) – Number of bits to read.

  • signed (bool) – If signed is True, convert bits to a signed int. Default is False.

Returns:

  • value (int) – Value of bits read.

  • bit_pointer (int) – Bit position after reading.