Class PackedBits8

java.lang.Object
boofcv.alg.fiducial.qrcode.PackedBits8
All Implemented Interfaces:
PackedBits

public class PackedBits8 extends Object implements PackedBits
Stores a set of bits inside a byte array
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    byte[]
    Integer array used to store bits
    int
    Number of bits stored
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    PackedBits8(int totalBits)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    append(byte[] data, int numberOfBits, boolean swapOrder)
    Appends data in the array.
    void
    append(int bits, int numberOfBits, boolean swapOrder)
    Appends bits on to the end of the stack.
    void
    append(PackedBits8 bits, int numberOfBits)
    Appends the bit array onto the end
    append(String text)
    Adds bits encoded as a binary string, i.e.
    int
     
    int
     
    int
    get(int which)
     
    int
    getArray(int index)
     
    void
    growArray(int amountBits, boolean saveValue)
    Increases the size of the data array so that it can store an addition number of bits
    boolean
    Checks to see if the usable data in 'other' is identical to the usable data in this.
    int
     
    int
    read(int location, int length, boolean swapOrder)
    Read bits from the array and store them in an int
    void
    resize(int totalBits)
     
    void
    set(int which, int value)
     
    void
     
    wrap(byte[] data, int numberOfBits)
     
    void
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface boofcv.alg.fiducial.qrcode.PackedBits

    print
  • Field Details

    • data

      public byte[] data
      Integer array used to store bits
    • size

      public int size
      Number of bits stored
  • Constructor Details

    • PackedBits8

      public PackedBits8(int totalBits)
    • PackedBits8

      public PackedBits8()
  • Method Details

    • wrap

      public static PackedBits8 wrap(byte[] data, int numberOfBits)
    • setTo

      public void setTo(PackedBits8 src)
    • isIdentical

      public boolean isIdentical(PackedBits8 other)
      Checks to see if the usable data in 'other' is identical to the usable data in this.
    • get

      public int get(int which)
      Specified by:
      get in interface PackedBits
    • set

      public void set(int which, int value)
      Specified by:
      set in interface PackedBits
    • append

      public void append(byte[] data, int numberOfBits, boolean swapOrder)
      Appends data in the array. Fractions of a byte are allowed
    • append

      public void append(int bits, int numberOfBits, boolean swapOrder)
      Appends bits on to the end of the stack.
      Parameters:
      bits - Storage for bits. Relevant bits start at the front.
      numberOfBits - Number of relevant bits in 'bits'
      swapOrder - If true then the first bit in 'bits' will be the last bit in this array.
    • append

      public void append(PackedBits8 bits, int numberOfBits)
      Appends the bit array onto the end
    • append

      public PackedBits8 append(String text)
      Adds bits encoded as a binary string, i.e. "100010010011"
    • read

      public int read(int location, int length, boolean swapOrder)
      Read bits from the array and store them in an int
      Parameters:
      location - The index of the first bit
      length - Number of bits to real up to 32
      swapOrder - Should the order be swapped?
      Returns:
      The read in data
    • getArray

      public int getArray(int index)
    • resize

      public void resize(int totalBits)
      Specified by:
      resize in interface PackedBits
    • growArray

      public void growArray(int amountBits, boolean saveValue)
      Increases the size of the data array so that it can store an addition number of bits
      Parameters:
      amountBits - Number of bits beyond 'size' that you wish the array to be able to store
      saveValue - if true it will save the value of the array. If false it will not copy it
    • zero

      public void zero()
      Specified by:
      zero in interface PackedBits
    • length

      public int length()
      Specified by:
      length in interface PackedBits
    • arrayLength

      public int arrayLength()
      Specified by:
      arrayLength in interface PackedBits
    • elementBits

      public int elementBits()
      Specified by:
      elementBits in interface PackedBits