java.lang.Object
com.google.zxing.qrcode.decoder.Version
See ISO 18004:2006 Annex D
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classEncapsulates the parameters for one error-correction block in one symbol version.static final classEncapsulates a set of error-correction blocks in one symbol version.Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int[]The centers of the alignment patterns.private final Version.ECBlocks[]The error correction blocks, by level.private final intThe total number of codewords.private static final int[]See ISO 18004:2006 Annex D.private final intThe number of this version.private static final Version[]All the QR code versions.Constructor Summary
ConstructorsModifierConstructorDescriptionprivateVersion(int versionNumber, int[] alignmentPatternCenters, Version.ECBlocks... ecBlocks) Encapsulates the data for one symbol version.Method Summary
Modifier and TypeMethodDescription(package private) BitMatrixSee ISO 18004:2006 Annex Eprivate static Version[]See ISO 18004:2006 6.5.1 Table 9(package private) static VersiondecodeVersionInformation(int versionBits) Decodes the version information from the raw version bits.int[]Gets the alignment pattern centers.intGets the dimension for the version.getECBlocksForLevel(ErrorCorrectionLevel ecLevel) Gets the EC blocks for the error correction level.static VersiongetProvisionalVersionForDimension(int dimension) Deduces version information purely from QR Code dimensions.intGets the total codewords.static VersiongetVersionForNumber(int versionNumber) Gets the version for the version number.intGets the version number.toString()Return the symbol version number in decimal.
Field Details
VERSION_DECODE_INFO
private static final int[] VERSION_DECODE_INFOSee ISO 18004:2006 Annex D. Element i represents the raw version bits that specify version i + 7VERSIONS
All the QR code versions.versionNumber
private final int versionNumberThe number of this version.alignmentPatternCenters
private final int[] alignmentPatternCentersThe centers of the alignment patterns.ecBlocks
The error correction blocks, by level.totalCodewords
private final int totalCodewordsThe total number of codewords.
Constructor Details
Version
Encapsulates the data for one symbol version.- Parameters:
versionNumber- the symbol version, from 1 through 40alignmentPatternCenters- alignment pattern coordinatesecBlocks- error correction blocks
Method Details
getVersionNumber
public int getVersionNumber()Gets the version number.- Returns:
- the version number
getAlignmentPatternCenters
public int[] getAlignmentPatternCenters()Gets the alignment pattern centers.- Returns:
- the alignment pattern centers
getTotalCodewords
public int getTotalCodewords()Gets the total codewords.- Returns:
- the total codewords
getDimensionForVersion
public int getDimensionForVersion()Gets the dimension for the version.- Returns:
- the dimension for version
getECBlocksForLevel
Gets the EC blocks for the error correction level.- Parameters:
ecLevel- the error correction level whose block layout to look up- Returns:
- the e c blocks for level
getProvisionalVersionForDimension
Deduces version information purely from QR Code dimensions.
- Parameters:
dimension- dimension in modules- Returns:
- Version for a QR Code of that dimension
- Throws:
FormatException- if dimension is not 1 mod 4
getVersionForNumber
Gets the version for the version number.- Parameters:
versionNumber- the symbol version to look up, from 1 through 40- Returns:
- the version for number
decodeVersionInformation
Decodes the version information from the raw version bits.- Parameters:
versionBits- raw version bits- Returns:
- the version they encode, or null if none is within 3 bits of them
buildFunctionPattern
BitMatrix buildFunctionPattern()See ISO 18004:2006 Annex E- Returns:
- a matrix of this version's dimension with the finder, separator, alignment, timing and version information patterns marked
toString
buildVersions
See ISO 18004:2006 6.5.1 Table 9- Returns:
- the table of all QR code symbol versions, 1 through 40