/*
* Copyright 2009 ZXing authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.zxing.pdf417;
import java.util.Arrays;
import java.util.Collection;
import com.google.zxing.common.detector.MathUtils;
/**
* @author SITA Lab (kevin.osullivan@sita.aero)
* @author Guenther Grau
*/
public final class PDF417Common {
public static final int NUMBER_OF_CODEWORDS = 929;
// Maximum Codewords (Data + Error).
public static final int MAX_CODEWORDS_IN_BARCODE = NUMBER_OF_CODEWORDS - 1;
public static final int MIN_ROWS_IN_BARCODE = 3;
public static final int MAX_ROWS_IN_BARCODE = 90;
// One left row indication column + max 30 data columns + one right row indicator column
//public static final int MAX_CODEWORDS_IN_ROW = 32;
public static final int MODULES_IN_CODEWORD = 17;
public static final int MODULES_IN_STOP_PATTERN = 18;
public static final int BARS_IN_MODULE = 8;
private static final int[] EMPTY_INT_ARRAY = {};
private PDF417Common() {
}
/**
* @param moduleBitCount values to sum
* @return sum of values
* @deprecated call {@link MathUtils#sum(int[])}
*/
@Deprecated
public static int getBitCountSum(int[] moduleBitCount) {
return MathUtils.sum(moduleBitCount);
}
public static int[] toIntArray(Collection<Integer> list) {
if (list == null || list.isEmpty()) {
return EMPTY_INT_ARRAY;
}
int[] result = new int[list.size()];
int i = 0;
for (Integer integer : list) {
result[i++] = integer;
}
return result;
}
/**
* @param symbol encoded symbol to translate to a codeword
* @return the codeword corresponding to the symbol.
*/
public static int getCodeword(int symbol) {
int i = Arrays.binarySearch(SYMBOL_TABLE, symbol & 0x3FFFF);
if (i < 0) {
return -1;
}
return (CODEWORD_TABLE[i] - 1) % NUMBER_OF_CODEWORDS;
}
/**
* The sorted table of all possible symbols. Extracted from the PDF417
* specification. The index of a symbol in this table corresponds to the
* index into the codeword table.
*/
public static final int[] SYMBOL_TABLE = {
0x1025e, 0x1027a, 0x1029e, 0x102bc, 0x102f2, 0x102f4, 0x1032e, 0x1034e, 0x1035c, 0x10396, 0x103a6, 0x103ac,
0x10422, 0x10428, 0x10436, 0x10442, 0x10444, 0x10448, 0x10450, 0x1045e, 0x10466, 0x1046c, 0x1047a, 0x10482,
0x1049e, 0x104a0, 0x104bc, 0x104c6, 0x104d8, 0x104ee, 0x104f2, 0x104f4, 0x10504, 0x10508, 0x10510, 0x1051e,
0x10520, 0x1053c, 0x10540, 0x10578, 0x10586, 0x1058c, 0x10598, 0x105b0, 0x105be, 0x105ce, 0x105dc, 0x105e2,
0x105e4, 0x105e8, 0x105f6, 0x1062e, 0x1064e, 0x1065c, 0x1068e, 0x1069c, 0x106b8, 0x106de, 0x106fa, 0x10716,
0x10726, 0x1072c, 0x10746, 0x1074c, 0x10758, 0x1076e, 0x10792, 0x10794, 0x107a2, 0x107a4, 0x107a8, 0x107b6,
0x10822, 0x10828, 0x10842, 0x10848, 0x10850, 0x1085e, 0x10866, 0x1086c, 0x1087a, 0x10882, 0x10884, 0x10890,
0x1089e, 0x108a0, 0x108bc, 0x108c6, 0x108cc, 0x108d8, 0x108ee, 0x108f2, 0x108f4, 0x10902, 0x10908, 0x1091e,
0x10920, 0x1093c, 0x10940, 0x10978, 0x10986, 0x10998, 0x109b0, 0x109be, 0x109ce, 0x109dc, 0x109e2, 0x109e4,
0x109e8, 0x109f6, 0x10a08, 0x10a10, 0x10a1e, 0x10a20, 0x10a3c, 0x10a40, 0x10a78, 0x10af0, 0x10b06, 0x10b0c,
0x10b18, 0x10b30, 0x10b3e, 0x10b60, 0x10b7c, 0x10b8e, 0x10b9c, 0x10bb8, 0x10bc2, 0x10bc4, 0x10bc8, 0x10bd0,
0x10bde, 0x10be6, 0x10bec, 0x10c2e, 0x10c4e, 0x10c5c, 0x10c62, 0x10c64, 0x10c68, 0x10c76, 0x10c8e, 0x10c9c,
0x10cb8, 0x10cc2, 0x10cc4, 0x10cc8, 0x10cd0, 0x10cde, 0x10ce6, 0x10cec, 0x10cfa, 0x10d0e, 0x10d1c, 0x10d38,
0x10d70, 0x10d7e, 0x10d82, 0x10d84, 0x10d88, 0x10d90, 0x10d9e, 0x10da0, 0x10dbc, 0x10dc6, 0x10dcc, 0x10dd8,
0x10dee, 0x10df2, 0x10df4, 0x10e16, 0x10e26, 0x10e2c, 0x10e46, 0x10e58, 0x10e6e, 0x10e86, 0x10e8c, 0x10e98,
0x10eb0, 0x10ebe, 0x10ece, 0x10edc, 0x10f0a, 0x10f12, 0x10f14, 0x10f22, 0x10f28, 0x10f36, 0x10f42, 0x10f44,
0x10f48, 0x10f50, 0x10f5e, 0x10f66, 0x10f6c, 0x10fb2, 0x10fb4, 0x11022, 0x11028, 0x11042, 0x11048, 0x11050,
0x1105e, 0x1107a, 0x11082, 0x11084, 0x11090, 0x1109e, 0x110a0, 0x110bc, 0x110c6, 0x110cc, 0x110d8, 0x110ee,
0x110f2, 0x110f4, 0x11102, 0x1111e, 0x11120, 0x1113c, 0x11140, 0x11178, 0x11186, 0x11198, 0x111b0, 0x111be,
0x111ce, 0x111dc, 0x111e2, 0x111e4, 0x111e8, 0x111f6, 0x11208, 0x1121e, 0x11220, 0x11278, 0x112f0, 0x1130c,
0x11330, 0x1133e, 0x11360, 0x1137c, 0x1138e, 0x1139c, 0x113b8, 0x113c2, 0x113c8, 0x113d0, 0x113de, 0x113e6,
0x113ec, 0x11408, 0x11410, 0x1141e, 0x11420, 0x1143c, 0x11440, 0x11478, 0x114f0, 0x115e0, 0x1160c, 0x11618,
0x11630, 0x1163e, 0x11660, 0x1167c, 0x116c0, 0x116f8, 0x1171c, 0x11738, 0x11770, 0x1177e, 0x11782, 0x11784,
0x11788, 0x11790, 0x1179e, 0x117a0, 0x117bc, 0x117c6, 0x117cc, 0x117d8, 0x117ee, 0x1182e, 0x11834, 0x1184e,
0x1185c, 0x11862, 0x11864, 0x11868, 0x11876, 0x1188e, 0x1189c, 0x118b8, 0x118c2, 0x118c8, 0x118d0, 0x118de,
0x118e6, 0x118ec, 0x118fa, 0x1190e, 0x1191c, 0x11938, 0x11970, 0x1197e, 0x11982, 0x11984, 0x11990, 0x1199e,
0x119a0, 0x119bc, 0x119c6, 0x119cc, 0x119d8, 0x119ee, 0x119f2, 0x119f4, 0x11a0e, 0x11a1c, 0x11a38, 0x11a70,
0x11a7e, 0x11ae0, 0x11afc, 0x11b08, 0x11b10, 0x11b1e, 0x11b20, 0x11b3c, 0x11b40, 0x11b78, 0x11b8c, 0x11b98,
0x11bb0, 0x11bbe, 0x11bce, 0x11bdc, 0x11be2, 0x11be4, 0x11be8, 0x11bf6, 0x11c16, 0x11c26, 0x11c2c, 0x11c46,
0x11c4c, 0x11c58, 0x11c6e, 0x11c86, 0x11c98, 0x11cb0, 0x11cbe, 0x11cce, 0x11cdc, 0x11ce2, 0x11ce4, 0x11ce8,
0x11cf6, 0x11d06, 0x11d0c, 0x11d18, 0x11d30, 0x11d3e, 0x11d60, 0x11d7c, 0x11d8e, 0x11d9c, 0x11db8, 0x11dc4,
0x11dc8, 0x11dd0, 0x11dde, 0x11de6, 0x11dec, 0x11dfa, 0x11e0a, 0x11e12, 0x11e14, 0x11e22, 0x11e24, 0x11e28,
0x11e36, 0x11e42, 0x11e44, 0x11e50, 0x11e5e, 0x11e66, 0x11e6c, 0x11e82, 0x11e84, 0x11e88, 0x11e90, 0x11e9e,
0x11ea0, 0x11ebc, 0x11ec6, 0x11ecc, 0x11ed8, 0x11eee, 0x11f1a, 0x11f2e, 0x11f32, 0x11f34, 0x11f4e, 0x11f5c,
0x11f62, 0x11f64, 0x11f68, 0x11f76, 0x12048, 0x1205e, 0x12082, 0x12084, 0x12090, 0x1209e, 0x120a0, 0x120bc,
0x120d8, 0x120f2, 0x120f4, 0x12108, 0x1211e, 0x12120, 0x1213c, 0x12140, 0x12178, 0x12186, 0x12198, 0x121b0,
0x121be, 0x121e2, 0x121e4, 0x121e8, 0x121f6, 0x12204, 0x12210, 0x1221e, 0x12220, 0x12278, 0x122f0, 0x12306,
0x1230c, 0x12330, 0x1233e, 0x12360, 0x1237c, 0x1238e, 0x1239c, 0x123b8, 0x123c2, 0x123c8, 0x123d0, 0x123e6,
0x123ec, 0x1241e, 0x12420, 0x1243c, 0x124f0, 0x125e0, 0x12618, 0x1263e, 0x12660, 0x1267c, 0x126c0, 0x126f8,
0x12738, 0x12770, 0x1277e, 0x12782, 0x12784, 0x12790, 0x1279e, 0x127a0, 0x127bc, 0x127c6, 0x127cc, 0x127d8,
0x127ee, 0x12820, 0x1283c, 0x12840, 0x12878, 0x128f0, 0x129e0, 0x12bc0, 0x12c18, 0x12c30, 0x12c3e, 0x12c60,
0x12c7c, 0x12cc0, 0x12cf8, 0x12df0, 0x12e1c, 0x12e38, 0x12e70, 0x12e7e, 0x12ee0, 0x12efc, 0x12f04, 0x12f08,
0x12f10, 0x12f20, 0x12f3c, 0x12f40, 0x12f78, 0x12f86, 0x12f8c, 0x12f98, 0x12fb0, 0x12fbe, 0x12fce, 0x12fdc,
0x1302e, 0x1304e, 0x1305c, 0x13062, 0x13068, 0x1308e, 0x1309c, 0x130b8, 0x130c2, 0x130c8, 0x130d0, 0x130de,
0x130ec, 0x130fa, 0x1310e, 0x13138, 0x13170, 0x1317e, 0x13182, 0x13184, 0x13190, 0x1319e, 0x131a0, 0x131bc,
0x131c6, 0x131cc, 0x131d8, 0x131f2, 0x131f4, 0x1320e, 0x1321c, 0x13270, 0x1327e, 0x132e0, 0x132fc, 0x13308,
0x1331e, 0x13320, 0x1333c, 0x13340, 0x13378, 0x13386, 0x13398, 0x133b0, 0x133be, 0x133ce, 0x133dc, 0x133e2,
0
没有合适的资源?快使用搜索试试~ 我知道了~
Zxing源码(3.3.4最新)
共3612个文件
png:1255个
txt:1088个
html:621个
需积分: 50 96 下载量 25 浏览量
2019-04-09
09:23:07
上传
评论 3
收藏 128.31MB ZIP 举报
温馨提示
github上zxing的源码,github下载速度慢特意分享在此,集成教程我写在博客
资源推荐
资源详情
资源评论
收起资源包目录
Zxing源码(3.3.4最新) (3612个子文件)
AUTHORS 2KB
02.bin 7KB
24.bin 748B
01.bin 748B
09.bin 32B
bnd.bnd 698B
proguard.cfg 2KB
CHANGES 16KB
05-update-tomcat-server.config 102B
01-update.config 73B
apache-maven-fluido-1.6.min.css 123KB
apache-maven-fluido-1.5.min.css 107KB
stylesheet.css 13KB
Generator.css 2KB
print.css 1KB
style.css 545B
style.css 544B
style.css 340B
scan.css 298B
site.css 53B
.editorconfig 147B
glyphicons-halflings-regular.eot 35KB
HelloWorld_Text_L_Kaywa_6_error_byte.png.error 4KB
update.gif 1KB
icon_help_sml.gif 1KB
icon_info_sml.gif 638B
icon_error_sml.gif 633B
icon_warning_sml.gif 625B
remove.gif 607B
icon_success_sml.gif 604B
add.gif 397B
fix.gif 366B
.gitattributes 396B
.gitignore 29B
.gitignore 15B
.gitignore 11B
.gitignore 8B
index-all.html 381KB
GUIRunner.html 89KB
BitMatrix.html 87KB
NotFoundException.html 84KB
Result.html 62KB
package-use.html 59KB
FormatException.html 57KB
DecodeHintType.html 56KB
IntentIntegrator.html 55KB
overview-tree.html 50KB
ChecksumException.html 41KB
BitArray.html 40KB
BinaryBitmap.html 38KB
BarcodeFormat.html 37KB
BitMatrix.html 36KB
ExpandedProductParsedResult.html 36KB
AddressBookParsedResult.html 35KB
MatrixToImageWriter.html 35KB
CharacterSetECI.html 32KB
WriterException.html 32KB
EncodeHintType.html 30KB
UPCAReader.html 30KB
EncodeHintType.html 30KB
OneDReader.html 28KB
BitArray.html 28KB
package-use.html 27KB
allclasses-frame.html 27KB
CalendarParsedResult.html 27KB
ResultPoint.html 26KB
DecodeHintType.html 26KB
ResultParser.html 26KB
PDF417ResultMetadata.html 26KB
Reader.html 25KB
ResultMetadataType.html 25KB
SymbolInfo.html 25KB
DecoderResult.html 25KB
Result.html 24KB
WifiParsedResult.html 24KB
BufferedImageLuminanceSource.html 24KB
BarcodeFormat.html 24KB
Mode.html 24KB
FinderPatternFinder.html 24KB
Detector.html 24KB
InvertedLuminanceSource.html 23KB
allclasses-noframe.html 23KB
GridSampler.html 23KB
UPCEANReader.html 23KB
PDF417Reader.html 23KB
OneDimensionalCodeWriter.html 22KB
LuminanceSource.html 22KB
LuminanceSource.html 22KB
ParsedResultType.html 22KB
VINParsedResult.html 22KB
BinaryBitmap.html 21KB
PlanarYUVLuminanceSource.html 21KB
QRCode.html 20KB
UPCEReader.html 20KB
ErrorCorrectionLevel.html 20KB
MultiFormatReader.html 20KB
Code93Writer.html 20KB
GenericGF.html 20KB
AbstractRSSReader.html 20KB
SMSParsedResult.html 20KB
共 3612 条
- 1
- 2
- 3
- 4
- 5
- 6
- 37
资源评论
孙先森i
- 粉丝: 862
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功