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>
40 ECB(int count, int dataCodewords);
42 int getDataCodewords();
48 std::vector<ECB*> ecBlocks_;
50 ECBlocks(int ecCodewords, ECB *ecBlocks);
51 ECBlocks(int ecCodewords, ECB *ecBlocks1, ECB *ecBlocks2);
53 std::vector<ECB*>& getECBlocks();
57 class Version : public Counted {
61 std::valarray<int> &alignmentPatternCenters_;
62 std::vector<ECBlocks*> ecBlocks_;
64 Version(int versionNumber, std::valarray<int> *alignmentPatternCenters, ECBlocks *ecBlocks1, ECBlocks *ecBlocks2,
65 ECBlocks *ecBlocks3, ECBlocks *ecBlocks4);
68 static unsigned int VERSION_DECODE_INFO[];
69 static int N_VERSION_DECODE_INFOS;
70 static std::vector<Ref<Version> > VERSIONS;
73 int getVersionNumber();
74 std::valarray<int> &getAlignmentPatternCenters();
75 int getTotalCodewords();
76 int getDimensionForVersion();
77 ECBlocks &getECBlocksForLevel(ErrorCorrectionLevel &ecLevel);
78 static Version *getProvisionalVersionForDimension(int dimension);
79 static Version *getVersionForNumber(int versionNumber);
80 static Version *decodeVersionInformation(unsigned int versionBits);
81 Ref<BitMatrix> buildFunctionPattern();
82 static int buildVersions();
87 #endif // __VERSION_H__