java.lang.Object
com.google.zxing.qrcode.decoder.FormatInformation
Encapsulates a QR Code's format information, including the data mask used and error correction level.
See DataMask- See Also:
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final byteThe data mask pattern the format bits name.private final ErrorCorrectionLevelThe level the format bits name.private static final int[][]See ISO 18004:2006, Annex C, Table C.1private static final intXor mask applied to the QR format bits.Constructor Summary
ConstructorsModifierConstructorDescriptionprivateFormatInformation(int formatInfo) Decodes the fifteen format bits.Method Summary
Modifier and TypeMethodDescription(package private) static FormatInformationdecodeFormatInformation(int maskedFormatInfo1, int maskedFormatInfo2) To establish best match if doesn't seem to match any known patternprivate static FormatInformationdoDecodeFormatInformation(int maskedFormatInfo1, int maskedFormatInfo2) Decode with optional mask XOR appliedbooleanTrue if the other object has the same error correction level and data mask.(package private) byteData mask reference decoded from format info bits.(package private) ErrorCorrectionLevelError correction level decoded from format info bits.inthashCode()Hash of the error correction level combined with the data mask.(package private) static intnumBitsDiffering(int a, int b) Counts the bits that differ between the two format info bit patterns.
Field Details
FORMAT_INFO_MASK_QR
private static final int FORMAT_INFO_MASK_QRXor mask applied to the QR format bits.- See Also:
FORMAT_INFO_DECODE_LOOKUP
private static final int[][] FORMAT_INFO_DECODE_LOOKUPSee ISO 18004:2006, Annex C, Table C.1errorCorrectionLevel
The level the format bits name.dataMask
private final byte dataMaskThe data mask pattern the format bits name.
Constructor Details
FormatInformation
private FormatInformation(int formatInfo) Decodes the fifteen format bits.- Parameters:
formatInfo- the raw format information
Method Details
numBitsDiffering
static int numBitsDiffering(int a, int b) Counts the bits that differ between the two format info bit patterns.- Parameters:
a- first of the two format info bit patterns to compareb- second of the two format info bit patterns to compare- Returns:
- number of differing bits
decodeFormatInformation
To establish best match if doesn't seem to match any known pattern- Parameters:
maskedFormatInfo1- format info indicator, with mask still appliedmaskedFormatInfo2- second copy of same info; both are checked at the same time- Returns:
- information about the format it specifies, or
null
doDecodeFormatInformation
private static FormatInformation doDecodeFormatInformation(int maskedFormatInfo1, int maskedFormatInfo2) Decode with optional mask XOR applied- Parameters:
maskedFormatInfo1- the format info bits read from the symbol, mask possibly appliedmaskedFormatInfo2- second copy of same info; both are checked at the same time- Returns:
- the matching format information, or null if nothing is within 3 bits
getErrorCorrectionLevel
ErrorCorrectionLevel getErrorCorrectionLevel()Error correction level decoded from format info bits.- Returns:
- the level selected by bits 3 and 4 of the format information
getDataMask
byte getDataMask()Data mask reference decoded from format info bits.- Returns:
- the 0-7 mask pattern reference taken from the bottom three bits
hashCode
equals