MatrixUtil.java (zxing-zxing-3.4.0) | : | MatrixUtil.java (zxing-zxing-3.4.1) | ||
---|---|---|---|---|
skipping to change at line 182 | skipping to change at line 182 | |||
// Place bits in LSB to MSB order. LSB (least significant bit) is the las t value in | // Place bits in LSB to MSB order. LSB (least significant bit) is the las t value in | |||
// "typeInfoBits". | // "typeInfoBits". | |||
boolean bit = typeInfoBits.get(typeInfoBits.getSize() - 1 - i); | boolean bit = typeInfoBits.get(typeInfoBits.getSize() - 1 - i); | |||
// Type info bits at the left top corner. See 8.9 of JISX0510:2004 (p.46). | // Type info bits at the left top corner. See 8.9 of JISX0510:2004 (p.46). | |||
int[] coordinates = TYPE_INFO_COORDINATES[i]; | int[] coordinates = TYPE_INFO_COORDINATES[i]; | |||
int x1 = coordinates[0]; | int x1 = coordinates[0]; | |||
int y1 = coordinates[1]; | int y1 = coordinates[1]; | |||
matrix.set(x1, y1, bit); | matrix.set(x1, y1, bit); | |||
int x2; | ||||
int y2; | ||||
if (i < 8) { | if (i < 8) { | |||
// Right top corner. | // Right top corner. | |||
int x2 = matrix.getWidth() - i - 1; | x2 = matrix.getWidth() - i - 1; | |||
int y2 = 8; | y2 = 8; | |||
matrix.set(x2, y2, bit); | ||||
} else { | } else { | |||
// Left bottom corner. | // Left bottom corner. | |||
int x2 = 8; | x2 = 8; | |||
int y2 = matrix.getHeight() - 7 + (i - 8); | y2 = matrix.getHeight() - 7 + (i - 8); | |||
matrix.set(x2, y2, bit); | ||||
} | } | |||
matrix.set(x2, y2, bit); | ||||
} | } | |||
} | } | |||
// Embed version information if need be. On success, modify the matrix and ret urn true. | // Embed version information if need be. On success, modify the matrix and ret urn true. | |||
// See 8.10 of JISX0510:2004 (p.47) for how to embed version information. | // See 8.10 of JISX0510:2004 (p.47) for how to embed version information. | |||
static void maybeEmbedVersionInfo(Version version, ByteMatrix matrix) throws W riterException { | static void maybeEmbedVersionInfo(Version version, ByteMatrix matrix) throws W riterException { | |||
if (version.getVersionNumber() < 7) { // Version info is necessary if versi on >= 7. | if (version.getVersionNumber() < 7) { // Version info is necessary if versi on >= 7. | |||
return; // Don't need version info. | return; // Don't need version info. | |||
} | } | |||
BitArray versionInfoBits = new BitArray(); | BitArray versionInfoBits = new BitArray(); | |||
End of changes. 4 change blocks. | ||||
6 lines changed or deleted | 7 lines changed or added |