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