Class BitMatrixParser
java.lang.Object
com.google.zxing.qrcode.decoder.BitMatrixParser
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BitMatrixprivate booleanprivate FormatInformationprivate Version -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate intcopyBit(int i, int j, int versionBits) (package private) voidmirror()Mirror the bit matrix in order to attempt a second reading.(package private) byte[]Reads the bits in theBitMatrixrepresenting the finder pattern in the correct order in order to reconstruct the codewords bytes contained within the QR Code.(package private) FormatInformationReads format information from one of its two locations within the QR Code.(package private) VersionReads version information from one of its two locations within the QR Code.(package private) voidremask()Revert the mask removal done while reading the code words.(package private) voidsetMirror(boolean mirror) Prepare the parser for a mirrored operation.
-
Field Details
-
bitMatrix
-
parsedVersion
-
parsedFormatInfo
-
mirror
private boolean mirror
-
-
Constructor Details
-
BitMatrixParser
BitMatrixParser(BitMatrix bitMatrix) throws FormatException - Parameters:
bitMatrix-BitMatrixto parse- Throws:
FormatException- if dimension is not >= 21 and 1 mod 4
-
-
Method Details
-
readFormatInformation
Reads format information from one of its two locations within the QR Code.
- Returns:
FormatInformationencapsulating the QR Code's format info- Throws:
FormatException- if both format information locations cannot be parsed as the valid encoding of format information
-
readVersion
Reads version information from one of its two locations within the QR Code.
- Returns:
Versionencapsulating the QR Code's version- Throws:
FormatException- if both version information locations cannot be parsed as the valid encoding of version information
-
copyBit
private int copyBit(int i, int j, int versionBits) -
readCodewords
Reads the bits in the
BitMatrixrepresenting the finder pattern in the correct order in order to reconstruct the codewords bytes contained within the QR Code.- Returns:
- bytes encoded within the QR Code
- Throws:
FormatException- if the exact number of bytes expected is not read
-
remask
void remask()Revert the mask removal done while reading the code words. The bit matrix should revert to its original state. -
setMirror
void setMirror(boolean mirror) Prepare the parser for a mirrored operation. This flag has effect only on thereadFormatInformation()and thereadVersion(). Before proceeding withreadCodewords()themirror()method should be called.- Parameters:
mirror- Whether to read version and format information mirrored.
-
mirror
void mirror()Mirror the bit matrix in order to attempt a second reading.
-