Package com.itextpdf.barcodes.qrcode
Class Version
- java.lang.Object
-
- com.itextpdf.barcodes.qrcode.Version
-
final class Version extends java.lang.Object
See ISO 18004:2006 Annex D.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Version.ECB
Encapsualtes the parameters for one error-correction block in one symbol version.static class
Version.ECBlocks
Encapsulates a set of error-correction blocks in one symbol version.
-
Field Summary
Fields Modifier and Type Field Description private int[]
alignmentPatternCenters
private Version.ECBlocks[]
ecBlocks
private int
totalCodewords
private static int[]
VERSION_DECODE_INFO
See ISO 18004:2006 Annex D.private int
versionNumber
private static Version[]
VERSIONS
-
Constructor Summary
Constructors Modifier Constructor Description private
Version(int versionNumber, int[] alignmentPatternCenters, Version.ECBlocks ecBlocks1, Version.ECBlocks ecBlocks2, Version.ECBlocks ecBlocks3, Version.ECBlocks ecBlocks4)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) BitMatrix
buildFunctionPattern()
Build the function pattern, See ISO 18004:2006 Annex E.private static Version[]
buildVersions()
See ISO 18004:2006 6.5.1 Table 9.(package private) static Version
decodeVersionInformation(int versionBits)
Decode the version information.int[]
getAlignmentPatternCenters()
int
getDimensionForVersion()
Version.ECBlocks
getECBlocksForLevel(ErrorCorrectionLevel ecLevel)
static Version
getProvisionalVersionForDimension(int dimension)
Deduces version information purely from QR Code dimensions.int
getTotalCodewords()
static Version
getVersionForNumber(int versionNumber)
int
getVersionNumber()
java.lang.String
toString()
-
-
-
Field Detail
-
VERSION_DECODE_INFO
private static final int[] VERSION_DECODE_INFO
See ISO 18004:2006 Annex D. Element i represents the raw version bits that specify version i + 7
-
VERSIONS
private static final Version[] VERSIONS
-
versionNumber
private final int versionNumber
-
alignmentPatternCenters
private final int[] alignmentPatternCenters
-
ecBlocks
private final Version.ECBlocks[] ecBlocks
-
totalCodewords
private final int totalCodewords
-
-
Constructor Detail
-
Version
private Version(int versionNumber, int[] alignmentPatternCenters, Version.ECBlocks ecBlocks1, Version.ECBlocks ecBlocks2, Version.ECBlocks ecBlocks3, Version.ECBlocks ecBlocks4)
-
-
Method Detail
-
getVersionNumber
public int getVersionNumber()
- Returns:
- the version number
-
getAlignmentPatternCenters
public int[] getAlignmentPatternCenters()
- Returns:
- int[] containing the positions of the alignment pattern centers
-
getTotalCodewords
public int getTotalCodewords()
- Returns:
- total number of code words
-
getDimensionForVersion
public int getDimensionForVersion()
- Returns:
- the square dimension for the current version number
-
getECBlocksForLevel
public Version.ECBlocks getECBlocksForLevel(ErrorCorrectionLevel ecLevel)
- Parameters:
ecLevel
- error correction level- Returns:
- the number of EC blocks for the given error correction level
-
getProvisionalVersionForDimension
public static Version getProvisionalVersionForDimension(int dimension)
Deduces version information purely from QR Code dimensions.- Parameters:
dimension
- dimension in modules- Returns:
Version
for a QR Code of that dimension
-
getVersionForNumber
public static Version getVersionForNumber(int versionNumber)
- Parameters:
versionNumber
- Version number- Returns:
- the version for the given version number
-
decodeVersionInformation
static Version decodeVersionInformation(int versionBits)
Decode the version information.- Parameters:
versionBits
- bits stored as int containing- Returns:
- Version decoded from the versionBits
-
buildFunctionPattern
BitMatrix buildFunctionPattern()
Build the function pattern, See ISO 18004:2006 Annex E.- Returns:
- Bitmatrix containing the pattern
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- Returns:
- The version number as a string
-
buildVersions
private static Version[] buildVersions()
See ISO 18004:2006 6.5.1 Table 9.
-
-