8 * Copyright 2010 ZXing authors All rights reserved.
10 * Licensed under the Apache License, Version 2.0 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
23 #include <zxing/common/Counted.h>
24 #include <zxing/qrcode/ErrorCorrectionLevel.h>
25 #include <zxing/ReaderException.h>
26 #include <zxing/common/BitMatrix.h>
27 #include <zxing/common/Counted.h>
38 ECB(int count, int dataCodewords);
40 int getDataCodewords();
46 std::vector<ECB*> ecBlocks_;
48 ECBlocks(int ecCodewords, ECB *ecBlocks);
49 ECBlocks(int ecCodewords, ECB *ecBlocks1, ECB *ecBlocks2);
51 std::vector<ECB*>& getECBlocks();
55 class Version : public Counted {
59 std::vector<int> &alignmentPatternCenters_;
60 std::vector<ECBlocks*> ecBlocks_;
62 Version(int versionNumber, std::vector<int> *alignmentPatternCenters, ECBlocks *ecBlocks1, ECBlocks *ecBlocks2,
63 ECBlocks *ecBlocks3, ECBlocks *ecBlocks4);
66 static unsigned int VERSION_DECODE_INFO[];
67 static int N_VERSION_DECODE_INFOS;
68 static std::vector<Ref<Version> > VERSIONS;
71 int getVersionNumber();
72 std::vector<int> &getAlignmentPatternCenters();
73 int getTotalCodewords();
74 int getDimensionForVersion();
75 ECBlocks &getECBlocksForLevel(ErrorCorrectionLevel &ecLevel);
76 static Version *getProvisionalVersionForDimension(int dimension);
77 static Version *getVersionForNumber(int versionNumber);
78 static Version *decodeVersionInformation(unsigned int versionBits);
79 Ref<BitMatrix> buildFunctionPattern();
80 static int buildVersions();
85 #endif // __VERSION_H__