X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=core%2Fsrc%2Fcom%2Fgoogle%2Fzxing%2Fqrcode%2Fdecoder%2FVersion.java;h=63273b68fb837f07d8cd5e4cd71c44d4027f5b22;hb=67bb87dea0eb848f80814f0353196079023a7aaf;hp=2bd6648faad4538bdbb26102b1a46d23afef80d8;hpb=9204484581a06a418b6f582ddf569f9e381305fb;p=zxing.git diff --git a/core/src/com/google/zxing/qrcode/decoder/Version.java b/core/src/com/google/zxing/qrcode/decoder/Version.java index 2bd6648f..63273b68 100755 --- a/core/src/com/google/zxing/qrcode/decoder/Version.java +++ b/core/src/com/google/zxing/qrcode/decoder/Version.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 Google Inc. + * Copyright 2007 ZXing authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,7 +22,7 @@ import com.google.zxing.common.BitMatrix; /** * See ISO 18004:2006 Annex D * - * @author srowen@google.com (Sean Owen) + * @author Sean Owen */ public final class Version { @@ -30,7 +30,7 @@ public final class Version { * See ISO 18004:2006 Annex D. * Element i represents the raw version bits that specify version i + 7 */ - private static final int[] VERSION_DECODE_INFO = new int[]{ + private static final int[] VERSION_DECODE_INFO = { 0x07C94, 0x085BC, 0x09A99, 0x0A4D3, 0x0BBF6, 0x0C762, 0x0D847, 0x0E60D, 0x0F928, 0x10B78, 0x1145D, 0x12A17, 0x13532, 0x149A6, 0x15683, @@ -55,14 +55,13 @@ public final class Version { ECBlocks ecBlocks4) { this.versionNumber = versionNumber; this.alignmentPatternCenters = alignmentPatternCenters; - this.ecBlocks = new ECBlocks[] { ecBlocks1, ecBlocks2, ecBlocks3, ecBlocks4 }; + this.ecBlocks = new ECBlocks[]{ecBlocks1, ecBlocks2, ecBlocks3, ecBlocks4}; int total = 0; - ECBlocks levelLECBlocks = ecBlocks1; // L,M,Q,H -- all the same total - int ecCodewords = levelLECBlocks.ecCodewords; - ECB[] ecbArray = levelLECBlocks.ecBlocks; + int ecCodewords = ecBlocks1.getECCodewords(); + ECB[] ecbArray = ecBlocks1.getECBlocks(); for (int i = 0; i < ecbArray.length; i++) { ECB ecBlock = ecbArray[i]; - total += ecBlock.count * (ecBlock.dataCodewords + ecCodewords); + total += ecBlock.getCount() * (ecBlock.getDataCodewords() + ecCodewords); } this.totalCodewords = total; } @@ -182,17 +181,17 @@ public final class Version { * will be the same across all blocks within one version.

*/ static final class ECBlocks { - private int ecCodewords; - private ECB[] ecBlocks; + private final int ecCodewords; + private final ECB[] ecBlocks; private ECBlocks(int ecCodewords, ECB ecBlocks) { this.ecCodewords = ecCodewords; - this.ecBlocks = new ECB[] { ecBlocks }; + this.ecBlocks = new ECB[]{ecBlocks}; } private ECBlocks(int ecCodewords, ECB ecBlocks1, ECB ecBlocks2) { this.ecCodewords = ecCodewords; - this.ecBlocks = new ECB[] { ecBlocks1, ecBlocks2 }; + this.ecBlocks = new ECB[]{ecBlocks1, ecBlocks2}; } int getECCodewords() { @@ -210,10 +209,10 @@ public final class Version { * parameters is used consecutively in the QR code version's format.

*/ static final class ECB { - private int count; - private int dataCodewords; + final int count; + final int dataCodewords; - private ECB(int count, int dataCodewords) { + ECB(int count, int dataCodewords) { this.count = count; this.dataCodewords = dataCodewords; } @@ -422,7 +421,7 @@ public final class Version { new ECBlocks(30, new ECB(30, 16), new ECB(2, 17))), new Version(25, new int[]{6, 32, 58, 84, 110}, - new ECBlocks(26, new ECB(8, 1061), + new ECBlocks(26, new ECB(8, 106), new ECB(4, 107)), new ECBlocks(28, new ECB(8, 47), new ECB(13, 48)),