com.google.zxing.oned.rss.expanded.RSSExpandedReader Java Examples
The following examples show how to use
com.google.zxing.oned.rss.expanded.RSSExpandedReader.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MultiFormatOneDReader.java From ScreenCapture with MIT License | 4 votes |
public MultiFormatOneDReader(Map<DecodeHintType,?> hints) { @SuppressWarnings("unchecked") Collection<BarcodeFormat> possibleFormats = hints == null ? null : (Collection<BarcodeFormat>) hints.get(DecodeHintType.POSSIBLE_FORMATS); boolean useCode39CheckDigit = hints != null && hints.get(DecodeHintType.ASSUME_CODE_39_CHECK_DIGIT) != null; Collection<OneDReader> readers = new ArrayList<>(); if (possibleFormats != null) { if (possibleFormats.contains(BarcodeFormat.EAN_13) || possibleFormats.contains(BarcodeFormat.UPC_A) || possibleFormats.contains(BarcodeFormat.EAN_8) || possibleFormats.contains(BarcodeFormat.UPC_E)) { readers.add(new MultiFormatUPCEANReader(hints)); } if (possibleFormats.contains(BarcodeFormat.CODE_39)) { readers.add(new Code39Reader(useCode39CheckDigit)); } if (possibleFormats.contains(BarcodeFormat.CODE_93)) { readers.add(new Code93Reader()); } if (possibleFormats.contains(BarcodeFormat.CODE_128)) { readers.add(new Code128Reader()); } if (possibleFormats.contains(BarcodeFormat.ITF)) { readers.add(new ITFReader()); } if (possibleFormats.contains(BarcodeFormat.CODABAR)) { readers.add(new CodaBarReader()); } if (possibleFormats.contains(BarcodeFormat.RSS_14)) { readers.add(new RSS14Reader()); } if (possibleFormats.contains(BarcodeFormat.RSS_EXPANDED)) { readers.add(new RSSExpandedReader()); } } if (readers.isEmpty()) { readers.add(new MultiFormatUPCEANReader(hints)); readers.add(new Code39Reader()); readers.add(new CodaBarReader()); readers.add(new Code93Reader()); readers.add(new Code128Reader()); readers.add(new ITFReader()); readers.add(new RSS14Reader()); readers.add(new RSSExpandedReader()); } this.readers = readers.toArray(new OneDReader[readers.size()]); }
Example #2
Source File: MultiFormatOneDReader.java From Tesseract-OCR-Scanner with Apache License 2.0 | 4 votes |
public MultiFormatOneDReader(Map<DecodeHintType,?> hints) { @SuppressWarnings("unchecked") Collection<BarcodeFormat> possibleFormats = hints == null ? null : (Collection<BarcodeFormat>) hints.get(DecodeHintType.POSSIBLE_FORMATS); boolean useCode39CheckDigit = hints != null && hints.get(DecodeHintType.ASSUME_CODE_39_CHECK_DIGIT) != null; Collection<OneDReader> readers = new ArrayList<>(); if (possibleFormats != null) { if (possibleFormats.contains(BarcodeFormat.EAN_13) || possibleFormats.contains(BarcodeFormat.UPC_A) || possibleFormats.contains(BarcodeFormat.EAN_8) || possibleFormats.contains(BarcodeFormat.UPC_E)) { readers.add(new MultiFormatUPCEANReader(hints)); } if (possibleFormats.contains(BarcodeFormat.CODE_39)) { readers.add(new Code39Reader(useCode39CheckDigit)); } if (possibleFormats.contains(BarcodeFormat.CODE_93)) { readers.add(new Code93Reader()); } if (possibleFormats.contains(BarcodeFormat.CODE_128)) { readers.add(new Code128Reader()); } if (possibleFormats.contains(BarcodeFormat.ITF)) { readers.add(new ITFReader()); } if (possibleFormats.contains(BarcodeFormat.CODABAR)) { readers.add(new CodaBarReader()); } if (possibleFormats.contains(BarcodeFormat.RSS_14)) { readers.add(new RSS14Reader()); } if (possibleFormats.contains(BarcodeFormat.RSS_EXPANDED)) { readers.add(new RSSExpandedReader()); } } if (readers.isEmpty()) { readers.add(new MultiFormatUPCEANReader(hints)); readers.add(new Code39Reader()); readers.add(new CodaBarReader()); readers.add(new Code93Reader()); readers.add(new Code128Reader()); readers.add(new ITFReader()); readers.add(new RSS14Reader()); readers.add(new RSSExpandedReader()); } this.readers = readers.toArray(new OneDReader[readers.size()]); }
Example #3
Source File: MultiFormatOneDReader.java From QrCodeScanner with GNU General Public License v3.0 | 4 votes |
public MultiFormatOneDReader(Map<DecodeHintType,?> hints) { @SuppressWarnings("unchecked") Collection<BarcodeFormat> possibleFormats = hints == null ? null : (Collection<BarcodeFormat>) hints.get(DecodeHintType.POSSIBLE_FORMATS); boolean useCode39CheckDigit = hints != null && hints.get(DecodeHintType.ASSUME_CODE_39_CHECK_DIGIT) != null; Collection<OneDReader> readers = new ArrayList<>(); if (possibleFormats != null) { if (possibleFormats.contains(BarcodeFormat.EAN_13) || possibleFormats.contains(BarcodeFormat.UPC_A) || possibleFormats.contains(BarcodeFormat.EAN_8) || possibleFormats.contains(BarcodeFormat.UPC_E)) { readers.add(new MultiFormatUPCEANReader(hints)); } if (possibleFormats.contains(BarcodeFormat.CODE_39)) { readers.add(new Code39Reader(useCode39CheckDigit)); } if (possibleFormats.contains(BarcodeFormat.CODE_93)) { readers.add(new Code93Reader()); } if (possibleFormats.contains(BarcodeFormat.CODE_128)) { readers.add(new Code128Reader()); } if (possibleFormats.contains(BarcodeFormat.ITF)) { readers.add(new ITFReader()); } if (possibleFormats.contains(BarcodeFormat.CODABAR)) { readers.add(new CodaBarReader()); } if (possibleFormats.contains(BarcodeFormat.RSS_14)) { readers.add(new RSS14Reader()); } if (possibleFormats.contains(BarcodeFormat.RSS_EXPANDED)) { readers.add(new RSSExpandedReader()); } } if (readers.isEmpty()) { readers.add(new MultiFormatUPCEANReader(hints)); readers.add(new Code39Reader()); readers.add(new CodaBarReader()); readers.add(new Code93Reader()); readers.add(new Code128Reader()); readers.add(new ITFReader()); readers.add(new RSS14Reader()); readers.add(new RSSExpandedReader()); } this.readers = readers.toArray(new OneDReader[readers.size()]); }
Example #4
Source File: MultiFormatOneDReader.java From ZXing-Orient with Apache License 2.0 | 4 votes |
public MultiFormatOneDReader(Map<DecodeHintType,?> hints) { @SuppressWarnings("unchecked") Collection<BarcodeFormat> possibleFormats = hints == null ? null : (Collection<BarcodeFormat>) hints.get(DecodeHintType.POSSIBLE_FORMATS); boolean useCode39CheckDigit = hints != null && hints.get(DecodeHintType.ASSUME_CODE_39_CHECK_DIGIT) != null; Collection<OneDReader> readers = new ArrayList<>(); if (possibleFormats != null) { if (possibleFormats.contains(BarcodeFormat.EAN_13) || possibleFormats.contains(BarcodeFormat.UPC_A) || possibleFormats.contains(BarcodeFormat.EAN_8) || possibleFormats.contains(BarcodeFormat.UPC_E)) { readers.add(new MultiFormatUPCEANReader(hints)); } if (possibleFormats.contains(BarcodeFormat.CODE_39)) { readers.add(new Code39Reader(useCode39CheckDigit)); } if (possibleFormats.contains(BarcodeFormat.CODE_93)) { readers.add(new Code93Reader()); } if (possibleFormats.contains(BarcodeFormat.CODE_128)) { readers.add(new Code128Reader()); } if (possibleFormats.contains(BarcodeFormat.ITF)) { readers.add(new ITFReader()); } if (possibleFormats.contains(BarcodeFormat.CODABAR)) { readers.add(new CodaBarReader()); } if (possibleFormats.contains(BarcodeFormat.RSS_14)) { readers.add(new RSS14Reader()); } if (possibleFormats.contains(BarcodeFormat.RSS_EXPANDED)){ readers.add(new RSSExpandedReader()); } } if (readers.isEmpty()) { readers.add(new MultiFormatUPCEANReader(hints)); readers.add(new Code39Reader()); readers.add(new CodaBarReader()); readers.add(new Code93Reader()); readers.add(new Code128Reader()); readers.add(new ITFReader()); readers.add(new RSS14Reader()); readers.add(new RSSExpandedReader()); } this.readers = readers.toArray(new OneDReader[readers.size()]); }
Example #5
Source File: MultiFormatOneDReader.java From analyzer-of-android-for-Apache-Weex with Apache License 2.0 | 4 votes |
public MultiFormatOneDReader(Map<DecodeHintType,?> hints) { @SuppressWarnings("unchecked") Collection<BarcodeFormat> possibleFormats = hints == null ? null : (Collection<BarcodeFormat>) hints.get(DecodeHintType.POSSIBLE_FORMATS); boolean useCode39CheckDigit = hints != null && hints.get(DecodeHintType.ASSUME_CODE_39_CHECK_DIGIT) != null; Collection<OneDReader> readers = new ArrayList<>(); if (possibleFormats != null) { if (possibleFormats.contains(BarcodeFormat.EAN_13) || possibleFormats.contains(BarcodeFormat.UPC_A) || possibleFormats.contains(BarcodeFormat.EAN_8) || possibleFormats.contains(BarcodeFormat.UPC_E)) { readers.add(new MultiFormatUPCEANReader(hints)); } if (possibleFormats.contains(BarcodeFormat.CODE_39)) { readers.add(new Code39Reader(useCode39CheckDigit)); } if (possibleFormats.contains(BarcodeFormat.CODE_93)) { readers.add(new Code93Reader()); } if (possibleFormats.contains(BarcodeFormat.CODE_128)) { readers.add(new Code128Reader()); } if (possibleFormats.contains(BarcodeFormat.ITF)) { readers.add(new ITFReader()); } if (possibleFormats.contains(BarcodeFormat.CODABAR)) { readers.add(new CodaBarReader()); } if (possibleFormats.contains(BarcodeFormat.RSS_14)) { readers.add(new RSS14Reader()); } if (possibleFormats.contains(BarcodeFormat.RSS_EXPANDED)){ readers.add(new RSSExpandedReader()); } } if (readers.isEmpty()) { readers.add(new MultiFormatUPCEANReader(hints)); readers.add(new Code39Reader()); readers.add(new CodaBarReader()); readers.add(new Code93Reader()); readers.add(new Code128Reader()); readers.add(new ITFReader()); readers.add(new RSS14Reader()); readers.add(new RSSExpandedReader()); } this.readers = readers.toArray(new OneDReader[readers.size()]); }
Example #6
Source File: MultiFormatOneDReader.java From weex with Apache License 2.0 | 4 votes |
public MultiFormatOneDReader(Map<DecodeHintType,?> hints) { @SuppressWarnings("unchecked") Collection<BarcodeFormat> possibleFormats = hints == null ? null : (Collection<BarcodeFormat>) hints.get(DecodeHintType.POSSIBLE_FORMATS); boolean useCode39CheckDigit = hints != null && hints.get(DecodeHintType.ASSUME_CODE_39_CHECK_DIGIT) != null; Collection<OneDReader> readers = new ArrayList<>(); if (possibleFormats != null) { if (possibleFormats.contains(BarcodeFormat.EAN_13) || possibleFormats.contains(BarcodeFormat.UPC_A) || possibleFormats.contains(BarcodeFormat.EAN_8) || possibleFormats.contains(BarcodeFormat.UPC_E)) { readers.add(new MultiFormatUPCEANReader(hints)); } if (possibleFormats.contains(BarcodeFormat.CODE_39)) { readers.add(new Code39Reader(useCode39CheckDigit)); } if (possibleFormats.contains(BarcodeFormat.CODE_93)) { readers.add(new Code93Reader()); } if (possibleFormats.contains(BarcodeFormat.CODE_128)) { readers.add(new Code128Reader()); } if (possibleFormats.contains(BarcodeFormat.ITF)) { readers.add(new ITFReader()); } if (possibleFormats.contains(BarcodeFormat.CODABAR)) { readers.add(new CodaBarReader()); } if (possibleFormats.contains(BarcodeFormat.RSS_14)) { readers.add(new RSS14Reader()); } if (possibleFormats.contains(BarcodeFormat.RSS_EXPANDED)){ readers.add(new RSSExpandedReader()); } } if (readers.isEmpty()) { readers.add(new MultiFormatUPCEANReader(hints)); readers.add(new Code39Reader()); readers.add(new CodaBarReader()); readers.add(new Code93Reader()); readers.add(new Code128Reader()); readers.add(new ITFReader()); readers.add(new RSS14Reader()); readers.add(new RSSExpandedReader()); } this.readers = readers.toArray(new OneDReader[readers.size()]); }
Example #7
Source File: MultiFormatOneDReader.java From barcodescanner-lib-aar with MIT License | 4 votes |
public MultiFormatOneDReader(Map<DecodeHintType,?> hints) { @SuppressWarnings("unchecked") Collection<BarcodeFormat> possibleFormats = hints == null ? null : (Collection<BarcodeFormat>) hints.get(DecodeHintType.POSSIBLE_FORMATS); boolean useCode39CheckDigit = hints != null && hints.get(DecodeHintType.ASSUME_CODE_39_CHECK_DIGIT) != null; Collection<OneDReader> readers = new ArrayList<>(); if (possibleFormats != null) { if (possibleFormats.contains(BarcodeFormat.EAN_13) || possibleFormats.contains(BarcodeFormat.UPC_A) || possibleFormats.contains(BarcodeFormat.EAN_8) || possibleFormats.contains(BarcodeFormat.UPC_E)) { readers.add(new MultiFormatUPCEANReader(hints)); } if (possibleFormats.contains(BarcodeFormat.CODE_39)) { readers.add(new Code39Reader(useCode39CheckDigit)); } if (possibleFormats.contains(BarcodeFormat.CODE_93)) { readers.add(new Code93Reader()); } if (possibleFormats.contains(BarcodeFormat.CODE_128)) { readers.add(new Code128Reader()); } if (possibleFormats.contains(BarcodeFormat.ITF)) { readers.add(new ITFReader()); } if (possibleFormats.contains(BarcodeFormat.CODABAR)) { readers.add(new CodaBarReader()); } if (possibleFormats.contains(BarcodeFormat.RSS_14)) { readers.add(new RSS14Reader()); } if (possibleFormats.contains(BarcodeFormat.RSS_EXPANDED)) { readers.add(new RSSExpandedReader()); } } if (readers.isEmpty()) { readers.add(new MultiFormatUPCEANReader(hints)); readers.add(new Code39Reader()); readers.add(new CodaBarReader()); readers.add(new Code93Reader()); readers.add(new Code128Reader()); readers.add(new ITFReader()); readers.add(new RSS14Reader()); readers.add(new RSSExpandedReader()); } this.readers = readers.toArray(new OneDReader[readers.size()]); }
Example #8
Source File: MultiFormatOneDReader.java From reacteu-app with MIT License | 4 votes |
public MultiFormatOneDReader(Map<DecodeHintType,?> hints) { Collection<BarcodeFormat> possibleFormats = hints == null ? null : (Collection<BarcodeFormat>) hints.get(DecodeHintType.POSSIBLE_FORMATS); boolean useCode39CheckDigit = hints != null && hints.get(DecodeHintType.ASSUME_CODE_39_CHECK_DIGIT) != null; Collection<OneDReader> readers = new ArrayList<OneDReader>(); if (possibleFormats != null) { if (possibleFormats.contains(BarcodeFormat.EAN_13) || possibleFormats.contains(BarcodeFormat.UPC_A) || possibleFormats.contains(BarcodeFormat.EAN_8) || possibleFormats.contains(BarcodeFormat.UPC_E)) { readers.add(new MultiFormatUPCEANReader(hints)); } if (possibleFormats.contains(BarcodeFormat.CODE_39)) { readers.add(new Code39Reader(useCode39CheckDigit)); } if (possibleFormats.contains(BarcodeFormat.CODE_93)) { readers.add(new Code93Reader()); } if (possibleFormats.contains(BarcodeFormat.CODE_128)) { readers.add(new Code128Reader()); } if (possibleFormats.contains(BarcodeFormat.ITF)) { readers.add(new ITFReader()); } if (possibleFormats.contains(BarcodeFormat.CODABAR)) { readers.add(new CodaBarReader()); } if (possibleFormats.contains(BarcodeFormat.RSS_14)) { readers.add(new RSS14Reader()); } if (possibleFormats.contains(BarcodeFormat.RSS_EXPANDED)){ readers.add(new RSSExpandedReader()); } } if (readers.isEmpty()) { readers.add(new MultiFormatUPCEANReader(hints)); readers.add(new Code39Reader()); readers.add(new CodaBarReader()); readers.add(new Code93Reader()); readers.add(new Code128Reader()); readers.add(new ITFReader()); readers.add(new RSS14Reader()); readers.add(new RSSExpandedReader()); } this.readers = readers.toArray(new OneDReader[readers.size()]); }
Example #9
Source File: SymbolTest.java From OkapiBarcode with Apache License 2.0 | 4 votes |
/** * Returns a ZXing reader that can read the specified symbol. * * @param symbol the symbol to be read * @return a ZXing reader that can read the specified symbol */ private static Reader findReader(Symbol symbol) { // TODO: see if we can massage data enough to check MaxiCode symbols against MaxiCodeReader instances if (symbol instanceof Code128 || symbol instanceof UspsPackage) { return new Code128Reader(); } else if (symbol instanceof Code93) { return new Code93Reader(); } else if (symbol instanceof Code3Of9) { return new Code39Reader(); } else if (symbol instanceof Codabar) { return new CodaBarReader(); } else if (symbol instanceof AztecCode && symbol.getDataType() != DataType.GS1 && symbol.getEciMode() == 3 && !symbol.getReaderInit() && !symbol.getContent().isEmpty()) { // ZXing does not currently support GS1 in Aztec Code symbols // ZXing does not currently support ECI in Aztec Code symbols // ZXing does not currently support reader initialization in Aztec Code symbols // ZXing cannot find symbols if they don't contain any actual data return new AztecReader(); } else if (symbol instanceof QrCode) { return new QRCodeReader(); } else if (symbol instanceof DataMatrix && symbol.getEciMode() == 3 && ((DataMatrix) symbol).getStructuredAppendTotal() == 1) { // ZXing does not currently support ECI in Data Matrix symbols // ZXing does not currently support Structured Append in Data Matrix symbols return new DataMatrixReader(); } else if (symbol instanceof Ean) { Ean ean = (Ean) symbol; if (ean.getMode() == Ean.Mode.EAN8) { return new EAN8Reader(); } else { return new EAN13Reader(); } } else if (symbol instanceof Pdf417) { Pdf417 pdf417 = (Pdf417) symbol; if (pdf417.getMode() != Pdf417.Mode.MICRO) { return new PDF417Reader(); } } else if (symbol instanceof Upc) { Upc upc = (Upc) symbol; if (upc.getMode() == Upc.Mode.UPCA) { return new UPCAReader(); } else { return new UPCEReader(); } } else if (symbol instanceof DataBarExpanded) { return new RSSExpandedReader(); } else if (symbol instanceof DataBar14 && !((DataBar14) symbol).getLinkageFlag()) { return new RSS14Reader(); } // no corresponding ZXing reader exists, or it behaves badly so we don't use it for testing return null; }