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 of a byte array
  • Field Summary

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

    Constructors
    Constructor Description
    PackedBits8()  
    PackedBits8​(int totalBits)  
  • Method Summary

    Modifier and Type Method Description
    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
    int arrayLength()  
    int elementBits()  
    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
    int length()  
    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 setTo​(PackedBits8 src)  
    static PackedBits8 wrap​(byte[] data, int numberOfBits)  
    void zero()  

    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)
    • 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​(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
    • 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