Package boofcv.alg.fiducial.qrcode
Class PackedBits8
java.lang.Object
boofcv.alg.fiducial.qrcode.PackedBits8
- All Implemented Interfaces:
PackedBits
Stores a set of bits inside a byte array
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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 endAdds 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 bitsboolean
isIdentical
(PackedBits8 other) Checks to see if the usable data in 'other' is identical to the usable data in this.int
length()
int
read
(int location, int length, boolean swapOrder) Read bits from the array and store them in an intvoid
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[] dataInteger array used to store bits -
size
public int sizeNumber of bits stored
-
-
Constructor Details
-
PackedBits8
public PackedBits8(int totalBits) -
PackedBits8
public PackedBits8()
-
-
Method Details
-
wrap
-
setTo
-
isIdentical
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 interfacePackedBits
-
set
public void set(int which, int value) - Specified by:
set
in interfacePackedBits
-
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
Appends the bit array onto the end -
append
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 bitlength
- Number of bits to real up to 32swapOrder
- 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 interfacePackedBits
-
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 storesaveValue
- 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 interfacePackedBits
-
length
public int length()- Specified by:
length
in interfacePackedBits
-
arrayLength
public int arrayLength()- Specified by:
arrayLength
in interfacePackedBits
-
elementBits
public int elementBits()- Specified by:
elementBits
in interfacePackedBits
-