use of com.google.zxing.oned.rss.expanded.decoders.AbstractExpandedDecoder in project weex-example by KalicyZhou.
the class RSSExpandedReader method constructResult.
// Not private for unit testing
static Result constructResult(List<ExpandedPair> pairs) throws NotFoundException, FormatException {
BitArray binary = BitArrayBuilder.buildBitArray(pairs);
AbstractExpandedDecoder decoder = AbstractExpandedDecoder.createDecoder(binary);
String resultingString = decoder.parseInformation();
ResultPoint[] firstPoints = pairs.get(0).getFinderPattern().getResultPoints();
ResultPoint[] lastPoints = pairs.get(pairs.size() - 1).getFinderPattern().getResultPoints();
return new Result(resultingString, null, new ResultPoint[] { firstPoints[0], firstPoints[1], lastPoints[0], lastPoints[1] }, BarcodeFormat.RSS_EXPANDED);
}
use of com.google.zxing.oned.rss.expanded.decoders.AbstractExpandedDecoder in project zxing by zxing.
the class ExpandedInformationDecoderTest method testNoAi.
@Test
public void testNoAi() throws Exception {
BitArray information = BinaryUtil.buildBitArrayFromString(" .......X ..XX..X. X.X....X .......X ....");
AbstractExpandedDecoder decoder = AbstractExpandedDecoder.createDecoder(information);
String decoded = decoder.parseInformation();
assertEquals("(10)12A", decoded);
}
use of com.google.zxing.oned.rss.expanded.decoders.AbstractExpandedDecoder in project zxing by zxing.
the class RSSExpandedReader method constructResult.
// Not private for unit testing
static Result constructResult(List<ExpandedPair> pairs) throws NotFoundException, FormatException {
BitArray binary = BitArrayBuilder.buildBitArray(pairs);
AbstractExpandedDecoder decoder = AbstractExpandedDecoder.createDecoder(binary);
String resultingString = decoder.parseInformation();
ResultPoint[] firstPoints = pairs.get(0).getFinderPattern().getResultPoints();
ResultPoint[] lastPoints = pairs.get(pairs.size() - 1).getFinderPattern().getResultPoints();
return new Result(resultingString, null, new ResultPoint[] { firstPoints[0], firstPoints[1], lastPoints[0], lastPoints[1] }, BarcodeFormat.RSS_EXPANDED);
}
Aggregations