react-native-nitro-zxing 0.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -0
- package/VisionCameraZxing.podspec +48 -0
- package/android/CMakeLists.txt +43 -0
- package/android/build.gradle +150 -0
- package/android/fix-prefab.gradle +51 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/cpp/cpp-adapter.cpp +7 -0
- package/android/src/main/java/com/margelo/nitro/camera/zxing/VisionCameraZxingPackage.kt +21 -0
- package/cpp/BarcodeValueTypeClassifier.cpp +70 -0
- package/cpp/BarcodeValueTypeClassifier.hpp +14 -0
- package/cpp/FrameImageView.cpp +75 -0
- package/cpp/FrameImageView.hpp +34 -0
- package/cpp/HybridBarcode.cpp +59 -0
- package/cpp/HybridBarcode.hpp +26 -0
- package/cpp/HybridBarcodeScanner.cpp +121 -0
- package/cpp/HybridBarcodeScanner.hpp +26 -0
- package/cpp/HybridBarcodeScannerFactory.cpp +11 -0
- package/cpp/HybridBarcodeScannerFactory.hpp +14 -0
- package/cpp/ImageDownscaler.cpp +34 -0
- package/cpp/ImageDownscaler.hpp +21 -0
- package/cpp/ZXingDecoder.cpp +189 -0
- package/cpp/ZXingDecoder.hpp +72 -0
- package/cpp/zxing-core/LICENSE +202 -0
- package/cpp/zxing-core/README.md +156 -0
- package/cpp/zxing-core/core/CMakeLists.txt +784 -0
- package/cpp/zxing-core/core/Version.h.in +28 -0
- package/cpp/zxing-core/core/ZXingConfig.cmake.in +9 -0
- package/cpp/zxing-core/core/src/Barcode.cpp +255 -0
- package/cpp/zxing-core/core/src/Barcode.h +191 -0
- package/cpp/zxing-core/core/src/BarcodeData.h +100 -0
- package/cpp/zxing-core/core/src/BarcodeFormat.cpp +286 -0
- package/cpp/zxing-core/core/src/BarcodeFormat.h +272 -0
- package/cpp/zxing-core/core/src/BinaryBitmap.cpp +111 -0
- package/cpp/zxing-core/core/src/BinaryBitmap.h +66 -0
- package/cpp/zxing-core/core/src/BitArray.cpp +38 -0
- package/cpp/zxing-core/core/src/BitArray.h +181 -0
- package/cpp/zxing-core/core/src/BitMatrix.cpp +175 -0
- package/cpp/zxing-core/core/src/BitMatrix.h +199 -0
- package/cpp/zxing-core/core/src/BitMatrixCursor.h +253 -0
- package/cpp/zxing-core/core/src/BitMatrixIO.cpp +101 -0
- package/cpp/zxing-core/core/src/BitMatrixIO.h +21 -0
- package/cpp/zxing-core/core/src/BitSource.cpp +77 -0
- package/cpp/zxing-core/core/src/BitSource.h +72 -0
- package/cpp/zxing-core/core/src/ByteArray.h +42 -0
- package/cpp/zxing-core/core/src/CharacterSet.cpp +78 -0
- package/cpp/zxing-core/core/src/CharacterSet.h +58 -0
- package/cpp/zxing-core/core/src/ConcentricFinder.cpp +312 -0
- package/cpp/zxing-core/core/src/ConcentricFinder.h +156 -0
- package/cpp/zxing-core/core/src/Content.cpp +471 -0
- package/cpp/zxing-core/core/src/Content.h +82 -0
- package/cpp/zxing-core/core/src/ContentType.h +19 -0
- package/cpp/zxing-core/core/src/CreateBarcode.cpp +490 -0
- package/cpp/zxing-core/core/src/CreateBarcode.h +132 -0
- package/cpp/zxing-core/core/src/DecoderResult.h +92 -0
- package/cpp/zxing-core/core/src/DetectorResult.h +44 -0
- package/cpp/zxing-core/core/src/ECI.cpp +81 -0
- package/cpp/zxing-core/core/src/ECI.h +78 -0
- package/cpp/zxing-core/core/src/Error.cpp +29 -0
- package/cpp/zxing-core/core/src/Error.h +79 -0
- package/cpp/zxing-core/core/src/Flags.h +165 -0
- package/cpp/zxing-core/core/src/GTIN.cpp +253 -0
- package/cpp/zxing-core/core/src/GTIN.h +58 -0
- package/cpp/zxing-core/core/src/GlobalHistogramBinarizer.cpp +197 -0
- package/cpp/zxing-core/core/src/GlobalHistogramBinarizer.h +34 -0
- package/cpp/zxing-core/core/src/GridSampler.cpp +124 -0
- package/cpp/zxing-core/core/src/GridSampler.h +59 -0
- package/cpp/zxing-core/core/src/HRI.cpp +343 -0
- package/cpp/zxing-core/core/src/HRI.h +16 -0
- package/cpp/zxing-core/core/src/HybridBinarizer.cpp +315 -0
- package/cpp/zxing-core/core/src/HybridBinarizer.h +40 -0
- package/cpp/zxing-core/core/src/ImageView.h +168 -0
- package/cpp/zxing-core/core/src/JSON.cpp +154 -0
- package/cpp/zxing-core/core/src/JSON.h +66 -0
- package/cpp/zxing-core/core/src/LocalGrid.cpp +242 -0
- package/cpp/zxing-core/core/src/LocalGrid.h +91 -0
- package/cpp/zxing-core/core/src/LogMatrix.h +105 -0
- package/cpp/zxing-core/core/src/Matrix.h +125 -0
- package/cpp/zxing-core/core/src/MultiFormatReader.cpp +107 -0
- package/cpp/zxing-core/core/src/MultiFormatReader.h +34 -0
- package/cpp/zxing-core/core/src/MultiFormatWriter.cpp +111 -0
- package/cpp/zxing-core/core/src/MultiFormatWriter.h +62 -0
- package/cpp/zxing-core/core/src/Pattern.h +472 -0
- package/cpp/zxing-core/core/src/PerspectiveTransform.cpp +81 -0
- package/cpp/zxing-core/core/src/PerspectiveTransform.h +47 -0
- package/cpp/zxing-core/core/src/Point.h +185 -0
- package/cpp/zxing-core/core/src/Quadrilateral.h +215 -0
- package/cpp/zxing-core/core/src/Range.h +112 -0
- package/cpp/zxing-core/core/src/ReadBarcode.cpp +335 -0
- package/cpp/zxing-core/core/src/ReadBarcode.h +33 -0
- package/cpp/zxing-core/core/src/Reader.h +32 -0
- package/cpp/zxing-core/core/src/ReaderOptions.h +210 -0
- package/cpp/zxing-core/core/src/ReedSolomon.cpp +100 -0
- package/cpp/zxing-core/core/src/ReedSolomon.h +66 -0
- package/cpp/zxing-core/core/src/RegressionLine.h +161 -0
- package/cpp/zxing-core/core/src/ResultPoint.cpp +20 -0
- package/cpp/zxing-core/core/src/ResultPoint.h +35 -0
- package/cpp/zxing-core/core/src/StdGenerator.h +121 -0
- package/cpp/zxing-core/core/src/StdPrint.h +38 -0
- package/cpp/zxing-core/core/src/StdScope.h +55 -0
- package/cpp/zxing-core/core/src/StructuredAppend.h +19 -0
- package/cpp/zxing-core/core/src/SymbologyIdentifier.h +29 -0
- package/cpp/zxing-core/core/src/TextDecoder.cpp +59 -0
- package/cpp/zxing-core/core/src/TextDecoder.h +23 -0
- package/cpp/zxing-core/core/src/TextEncoder.cpp +75 -0
- package/cpp/zxing-core/core/src/TextEncoder.h +31 -0
- package/cpp/zxing-core/core/src/ThresholdBinarizer.h +58 -0
- package/cpp/zxing-core/core/src/TritMatrix.h +29 -0
- package/cpp/zxing-core/core/src/Utf.cpp +276 -0
- package/cpp/zxing-core/core/src/Utf.h +26 -0
- package/cpp/zxing-core/core/src/WhiteRectDetector.cpp +276 -0
- package/cpp/zxing-core/core/src/WhiteRectDetector.h +36 -0
- package/cpp/zxing-core/core/src/WriteBarcode.cpp +213 -0
- package/cpp/zxing-core/core/src/WriteBarcode.h +72 -0
- package/cpp/zxing-core/core/src/ZXAlgorithms.h +353 -0
- package/cpp/zxing-core/core/src/ZXConfig.h +17 -0
- package/cpp/zxing-core/core/src/ZXTestSupport.h +9 -0
- package/cpp/zxing-core/core/src/ZXVersion.h +14 -0
- package/cpp/zxing-core/core/src/ZXingC.cpp +460 -0
- package/cpp/zxing-core/core/src/ZXingC.h +296 -0
- package/cpp/zxing-core/core/src/ZXingCpp.cpp +18 -0
- package/cpp/zxing-core/core/src/ZXingCpp.h +76 -0
- package/cpp/zxing-core/core/src/ZXingQt.h +606 -0
- package/cpp/zxing-core/core/src/aztec/AZDecoder.cpp +376 -0
- package/cpp/zxing-core/core/src/aztec/AZDecoder.h +20 -0
- package/cpp/zxing-core/core/src/aztec/AZDetector.cpp +508 -0
- package/cpp/zxing-core/core/src/aztec/AZDetector.h +25 -0
- package/cpp/zxing-core/core/src/aztec/AZDetectorResult.h +51 -0
- package/cpp/zxing-core/core/src/aztec/AZEncoder.cpp +318 -0
- package/cpp/zxing-core/core/src/aztec/AZEncoder.h +44 -0
- package/cpp/zxing-core/core/src/aztec/AZEncodingState.h +40 -0
- package/cpp/zxing-core/core/src/aztec/AZHighLevelEncoder.cpp +377 -0
- package/cpp/zxing-core/core/src/aztec/AZHighLevelEncoder.h +36 -0
- package/cpp/zxing-core/core/src/aztec/AZReader.cpp +45 -0
- package/cpp/zxing-core/core/src/aztec/AZReader.h +21 -0
- package/cpp/zxing-core/core/src/aztec/AZToken.cpp +44 -0
- package/cpp/zxing-core/core/src/aztec/AZToken.h +39 -0
- package/cpp/zxing-core/core/src/aztec/AZWriter.cpp +38 -0
- package/cpp/zxing-core/core/src/aztec/AZWriter.h +55 -0
- package/cpp/zxing-core/core/src/datamatrix/DMBitLayout.cpp +194 -0
- package/cpp/zxing-core/core/src/datamatrix/DMBitLayout.h +21 -0
- package/cpp/zxing-core/core/src/datamatrix/DMDataBlock.cpp +63 -0
- package/cpp/zxing-core/core/src/datamatrix/DMDataBlock.h +41 -0
- package/cpp/zxing-core/core/src/datamatrix/DMDecoder.cpp +457 -0
- package/cpp/zxing-core/core/src/datamatrix/DMDecoder.h +19 -0
- package/cpp/zxing-core/core/src/datamatrix/DMDetector.cpp +1230 -0
- package/cpp/zxing-core/core/src/datamatrix/DMDetector.h +23 -0
- package/cpp/zxing-core/core/src/datamatrix/DMECEncoder.cpp +137 -0
- package/cpp/zxing-core/core/src/datamatrix/DMECEncoder.h +26 -0
- package/cpp/zxing-core/core/src/datamatrix/DMEncoderContext.h +128 -0
- package/cpp/zxing-core/core/src/datamatrix/DMHighLevelEncoder.cpp +919 -0
- package/cpp/zxing-core/core/src/datamatrix/DMHighLevelEncoder.h +29 -0
- package/cpp/zxing-core/core/src/datamatrix/DMReader.cpp +40 -0
- package/cpp/zxing-core/core/src/datamatrix/DMReader.h +21 -0
- package/cpp/zxing-core/core/src/datamatrix/DMSymbolInfo.cpp +141 -0
- package/cpp/zxing-core/core/src/datamatrix/DMSymbolInfo.h +78 -0
- package/cpp/zxing-core/core/src/datamatrix/DMSymbolShape.h +17 -0
- package/cpp/zxing-core/core/src/datamatrix/DMVersion.cpp +82 -0
- package/cpp/zxing-core/core/src/datamatrix/DMVersion.h +76 -0
- package/cpp/zxing-core/core/src/datamatrix/DMWriter.cpp +114 -0
- package/cpp/zxing-core/core/src/datamatrix/DMWriter.h +62 -0
- package/cpp/zxing-core/core/src/librscpp/README.md +65 -0
- package/cpp/zxing-core/core/src/librscpp/decode.h +258 -0
- package/cpp/zxing-core/core/src/librscpp/encode.h +124 -0
- package/cpp/zxing-core/core/src/librscpp/field.h +158 -0
- package/cpp/zxing-core/core/src/librscpp/poly.h +194 -0
- package/cpp/zxing-core/core/src/libzint/2of5inter.c +1 -0
- package/cpp/zxing-core/core/src/libzint/2of5inter_based.c +1 -0
- package/cpp/zxing-core/core/src/libzint/aztec.c +1 -0
- package/cpp/zxing-core/core/src/libzint/aztec.h +1 -0
- package/cpp/zxing-core/core/src/libzint/big5.h +1 -0
- package/cpp/zxing-core/core/src/libzint/codabar.c +1 -0
- package/cpp/zxing-core/core/src/libzint/code.c +1 -0
- package/cpp/zxing-core/core/src/libzint/code128.c +1 -0
- package/cpp/zxing-core/core/src/libzint/code128.h +1 -0
- package/cpp/zxing-core/core/src/libzint/common.c +1 -0
- package/cpp/zxing-core/core/src/libzint/common.h +1 -0
- package/cpp/zxing-core/core/src/libzint/dmatrix.c +1 -0
- package/cpp/zxing-core/core/src/libzint/dmatrix.h +1 -0
- package/cpp/zxing-core/core/src/libzint/dxfilmedge.c +1 -0
- package/cpp/zxing-core/core/src/libzint/eci.c +1 -0
- package/cpp/zxing-core/core/src/libzint/eci.h +1 -0
- package/cpp/zxing-core/core/src/libzint/eci_sb.h +1 -0
- package/cpp/zxing-core/core/src/libzint/filemem.c +1 -0
- package/cpp/zxing-core/core/src/libzint/filemem.h +1 -0
- package/cpp/zxing-core/core/src/libzint/fonts/normal_woff2.h +1 -0
- package/cpp/zxing-core/core/src/libzint/fonts/upcean_woff2.h +1 -0
- package/cpp/zxing-core/core/src/libzint/gb18030.h +1 -0
- package/cpp/zxing-core/core/src/libzint/gb2312.h +1 -0
- package/cpp/zxing-core/core/src/libzint/gbk.h +1 -0
- package/cpp/zxing-core/core/src/libzint/general_field.c +1 -0
- package/cpp/zxing-core/core/src/libzint/general_field.h +1 -0
- package/cpp/zxing-core/core/src/libzint/gs1.c +1 -0
- package/cpp/zxing-core/core/src/libzint/gs1.h +1 -0
- package/cpp/zxing-core/core/src/libzint/gs1_lint.h +1 -0
- package/cpp/zxing-core/core/src/libzint/iso3166.h +1 -0
- package/cpp/zxing-core/core/src/libzint/iso4217.h +1 -0
- package/cpp/zxing-core/core/src/libzint/ksx1001.h +1 -0
- package/cpp/zxing-core/core/src/libzint/large.c +1 -0
- package/cpp/zxing-core/core/src/libzint/large.h +1 -0
- package/cpp/zxing-core/core/src/libzint/library.c +1 -0
- package/cpp/zxing-core/core/src/libzint/maxicode.c +1 -0
- package/cpp/zxing-core/core/src/libzint/maxicode.h +1 -0
- package/cpp/zxing-core/core/src/libzint/medical.c +1 -0
- package/cpp/zxing-core/core/src/libzint/output.c +1 -0
- package/cpp/zxing-core/core/src/libzint/output.h +1 -0
- package/cpp/zxing-core/core/src/libzint/pdf417.c +1 -0
- package/cpp/zxing-core/core/src/libzint/pdf417.h +1 -0
- package/cpp/zxing-core/core/src/libzint/pdf417_tabs.h +1 -0
- package/cpp/zxing-core/core/src/libzint/qr.c +1 -0
- package/cpp/zxing-core/core/src/libzint/qr.h +1 -0
- package/cpp/zxing-core/core/src/libzint/raster.c +1 -0
- package/cpp/zxing-core/core/src/libzint/raster_font.h +1 -0
- package/cpp/zxing-core/core/src/libzint/reedsol.c +1 -0
- package/cpp/zxing-core/core/src/libzint/reedsol.h +1 -0
- package/cpp/zxing-core/core/src/libzint/reedsol_logs.h +1 -0
- package/cpp/zxing-core/core/src/libzint/rss.c +1 -0
- package/cpp/zxing-core/core/src/libzint/rss.h +1 -0
- package/cpp/zxing-core/core/src/libzint/sjis.h +1 -0
- package/cpp/zxing-core/core/src/libzint/stubs.c +137 -0
- package/cpp/zxing-core/core/src/libzint/svg.c +1 -0
- package/cpp/zxing-core/core/src/libzint/telepen.c +1 -0
- package/cpp/zxing-core/core/src/libzint/upcean.c +1 -0
- package/cpp/zxing-core/core/src/libzint/vector.c +1 -0
- package/cpp/zxing-core/core/src/libzint/zfiletypes.h +1 -0
- package/cpp/zxing-core/core/src/libzint/zint.h +1 -0
- package/cpp/zxing-core/core/src/libzint/zintconfig.h +1 -0
- package/cpp/zxing-core/core/src/libzueci/README.md +11 -0
- package/cpp/zxing-core/core/src/libzueci/zueci.c +1718 -0
- package/cpp/zxing-core/core/src/libzueci/zueci.h +179 -0
- package/cpp/zxing-core/core/src/libzueci/zueci_big5.h +3884 -0
- package/cpp/zxing-core/core/src/libzueci/zueci_common.h +31 -0
- package/cpp/zxing-core/core/src/libzueci/zueci_gb18030.h +264 -0
- package/cpp/zxing-core/core/src/libzueci/zueci_gb2312.h +2381 -0
- package/cpp/zxing-core/core/src/libzueci/zueci_gbk.h +4047 -0
- package/cpp/zxing-core/core/src/libzueci/zueci_ksx1001.h +2932 -0
- package/cpp/zxing-core/core/src/libzueci/zueci_sb.h +1112 -0
- package/cpp/zxing-core/core/src/libzueci/zueci_sjis.h +2286 -0
- package/cpp/zxing-core/core/src/maxicode/MCBitMatrixParser.cpp +68 -0
- package/cpp/zxing-core/core/src/maxicode/MCBitMatrixParser.h +30 -0
- package/cpp/zxing-core/core/src/maxicode/MCDecoder.cpp +329 -0
- package/cpp/zxing-core/core/src/maxicode/MCDecoder.h +19 -0
- package/cpp/zxing-core/core/src/maxicode/MCReader.cpp +65 -0
- package/cpp/zxing-core/core/src/maxicode/MCReader.h +21 -0
- package/cpp/zxing-core/core/src/oned/ODCodabarReader.cpp +102 -0
- package/cpp/zxing-core/core/src/oned/ODCodabarReader.h +21 -0
- package/cpp/zxing-core/core/src/oned/ODCodabarWriter.cpp +136 -0
- package/cpp/zxing-core/core/src/oned/ODCodabarWriter.h +34 -0
- package/cpp/zxing-core/core/src/oned/ODCode128Patterns.h +130 -0
- package/cpp/zxing-core/core/src/oned/ODCode128Reader.cpp +236 -0
- package/cpp/zxing-core/core/src/oned/ODCode128Reader.h +21 -0
- package/cpp/zxing-core/core/src/oned/ODCode128Writer.cpp +261 -0
- package/cpp/zxing-core/core/src/oned/ODCode128Writer.h +34 -0
- package/cpp/zxing-core/core/src/oned/ODCode39Reader.cpp +213 -0
- package/cpp/zxing-core/core/src/oned/ODCode39Reader.h +26 -0
- package/cpp/zxing-core/core/src/oned/ODCode39Writer.cpp +176 -0
- package/cpp/zxing-core/core/src/oned/ODCode39Writer.h +34 -0
- package/cpp/zxing-core/core/src/oned/ODCode93Patterns.h +80 -0
- package/cpp/zxing-core/core/src/oned/ODCode93Reader.cpp +112 -0
- package/cpp/zxing-core/core/src/oned/ODCode93Reader.h +21 -0
- package/cpp/zxing-core/core/src/oned/ODCode93Writer.cpp +192 -0
- package/cpp/zxing-core/core/src/oned/ODCode93Writer.h +32 -0
- package/cpp/zxing-core/core/src/oned/ODDXFilmEdgeReader.cpp +246 -0
- package/cpp/zxing-core/core/src/oned/ODDXFilmEdgeReader.h +26 -0
- package/cpp/zxing-core/core/src/oned/ODDataBarCommon.cpp +172 -0
- package/cpp/zxing-core/core/src/oned/ODDataBarCommon.h +204 -0
- package/cpp/zxing-core/core/src/oned/ODDataBarExpandedBitDecoder.cpp +253 -0
- package/cpp/zxing-core/core/src/oned/ODDataBarExpandedBitDecoder.h +19 -0
- package/cpp/zxing-core/core/src/oned/ODDataBarExpandedReader.cpp +383 -0
- package/cpp/zxing-core/core/src/oned/ODDataBarExpandedReader.h +25 -0
- package/cpp/zxing-core/core/src/oned/ODDataBarLimitedReader.cpp +163 -0
- package/cpp/zxing-core/core/src/oned/ODDataBarLimitedReader.h +23 -0
- package/cpp/zxing-core/core/src/oned/ODDataBarReader.cpp +240 -0
- package/cpp/zxing-core/core/src/oned/ODDataBarReader.h +25 -0
- package/cpp/zxing-core/core/src/oned/ODEAN13Writer.cpp +62 -0
- package/cpp/zxing-core/core/src/oned/ODEAN13Writer.h +34 -0
- package/cpp/zxing-core/core/src/oned/ODEAN8Writer.cpp +51 -0
- package/cpp/zxing-core/core/src/oned/ODEAN8Writer.h +34 -0
- package/cpp/zxing-core/core/src/oned/ODITFReader.cpp +97 -0
- package/cpp/zxing-core/core/src/oned/ODITFReader.h +33 -0
- package/cpp/zxing-core/core/src/oned/ODITFWriter.cpp +78 -0
- package/cpp/zxing-core/core/src/oned/ODITFWriter.h +34 -0
- package/cpp/zxing-core/core/src/oned/ODMultiUPCEANReader.cpp +323 -0
- package/cpp/zxing-core/core/src/oned/ODMultiUPCEANReader.h +32 -0
- package/cpp/zxing-core/core/src/oned/ODReader.cpp +259 -0
- package/cpp/zxing-core/core/src/oned/ODReader.h +35 -0
- package/cpp/zxing-core/core/src/oned/ODRowReader.h +222 -0
- package/cpp/zxing-core/core/src/oned/ODTelepenReader.cpp +199 -0
- package/cpp/zxing-core/core/src/oned/ODTelepenReader.h +25 -0
- package/cpp/zxing-core/core/src/oned/ODUPCAWriter.cpp +33 -0
- package/cpp/zxing-core/core/src/oned/ODUPCAWriter.h +34 -0
- package/cpp/zxing-core/core/src/oned/ODUPCEANCommon.cpp +80 -0
- package/cpp/zxing-core/core/src/oned/ODUPCEANCommon.h +129 -0
- package/cpp/zxing-core/core/src/oned/ODUPCEWriter.cpp +56 -0
- package/cpp/zxing-core/core/src/oned/ODUPCEWriter.h +34 -0
- package/cpp/zxing-core/core/src/oned/ODWriterHelper.cpp +39 -0
- package/cpp/zxing-core/core/src/oned/ODWriterHelper.h +48 -0
- package/cpp/zxing-core/core/src/pdf417/MicroPDFReader.cpp +796 -0
- package/cpp/zxing-core/core/src/pdf417/MicroPDFReader.h +23 -0
- package/cpp/zxing-core/core/src/pdf417/PDF417.cpp +85 -0
- package/cpp/zxing-core/core/src/pdf417/PDF417.h +81 -0
- package/cpp/zxing-core/core/src/pdf417/PDFBarcodeMetadata.h +53 -0
- package/cpp/zxing-core/core/src/pdf417/PDFBarcodeValue.cpp +48 -0
- package/cpp/zxing-core/core/src/pdf417/PDFBarcodeValue.h +38 -0
- package/cpp/zxing-core/core/src/pdf417/PDFBoundingBox.cpp +116 -0
- package/cpp/zxing-core/core/src/pdf417/PDFBoundingBox.h +75 -0
- package/cpp/zxing-core/core/src/pdf417/PDFCodeword.h +71 -0
- package/cpp/zxing-core/core/src/pdf417/PDFCodewordDecoder.cpp +588 -0
- package/cpp/zxing-core/core/src/pdf417/PDFCodewordDecoder.h +41 -0
- package/cpp/zxing-core/core/src/pdf417/PDFCompaction.h +20 -0
- package/cpp/zxing-core/core/src/pdf417/PDFCustomData.h +32 -0
- package/cpp/zxing-core/core/src/pdf417/PDFDecoder.cpp +725 -0
- package/cpp/zxing-core/core/src/pdf417/PDFDecoder.h +20 -0
- package/cpp/zxing-core/core/src/pdf417/PDFDetectionResult.cpp +247 -0
- package/cpp/zxing-core/core/src/pdf417/PDFDetectionResult.h +74 -0
- package/cpp/zxing-core/core/src/pdf417/PDFDetectionResultColumn.cpp +321 -0
- package/cpp/zxing-core/core/src/pdf417/PDFDetectionResultColumn.h +83 -0
- package/cpp/zxing-core/core/src/pdf417/PDFDetector.cpp +371 -0
- package/cpp/zxing-core/core/src/pdf417/PDFDetector.h +45 -0
- package/cpp/zxing-core/core/src/pdf417/PDFEncoder.cpp +570 -0
- package/cpp/zxing-core/core/src/pdf417/PDFEncoder.h +182 -0
- package/cpp/zxing-core/core/src/pdf417/PDFHighLevelEncoder.cpp +570 -0
- package/cpp/zxing-core/core/src/pdf417/PDFHighLevelEncoder.h +32 -0
- package/cpp/zxing-core/core/src/pdf417/PDFReader.cpp +333 -0
- package/cpp/zxing-core/core/src/pdf417/PDFReader.h +28 -0
- package/cpp/zxing-core/core/src/pdf417/PDFScanningDecoder.cpp +559 -0
- package/cpp/zxing-core/core/src/pdf417/PDFScanningDecoder.h +41 -0
- package/cpp/zxing-core/core/src/pdf417/PDFWriter.cpp +170 -0
- package/cpp/zxing-core/core/src/pdf417/PDFWriter.h +74 -0
- package/cpp/zxing-core/core/src/pdf417/ZXBigInteger.cpp +623 -0
- package/cpp/zxing-core/core/src/pdf417/ZXBigInteger.h +81 -0
- package/cpp/zxing-core/core/src/pdf417/ZXNullable.h +105 -0
- package/cpp/zxing-core/core/src/qrcode/QRBitMatrixParser.cpp +294 -0
- package/cpp/zxing-core/core/src/qrcode/QRBitMatrixParser.h +41 -0
- package/cpp/zxing-core/core/src/qrcode/QRCodecMode.cpp +95 -0
- package/cpp/zxing-core/core/src/qrcode/QRCodecMode.h +59 -0
- package/cpp/zxing-core/core/src/qrcode/QRDataBlock.cpp +93 -0
- package/cpp/zxing-core/core/src/qrcode/QRDataBlock.h +52 -0
- package/cpp/zxing-core/core/src/qrcode/QRDataMask.h +50 -0
- package/cpp/zxing-core/core/src/qrcode/QRDecoder.cpp +359 -0
- package/cpp/zxing-core/core/src/qrcode/QRDecoder.h +19 -0
- package/cpp/zxing-core/core/src/qrcode/QRDetector.cpp +920 -0
- package/cpp/zxing-core/core/src/qrcode/QRDetector.h +45 -0
- package/cpp/zxing-core/core/src/qrcode/QRECB.h +52 -0
- package/cpp/zxing-core/core/src/qrcode/QREncodeResult.h +33 -0
- package/cpp/zxing-core/core/src/qrcode/QREncoder.cpp +568 -0
- package/cpp/zxing-core/core/src/qrcode/QREncoder.h +21 -0
- package/cpp/zxing-core/core/src/qrcode/QRErrorCorrectionLevel.cpp +51 -0
- package/cpp/zxing-core/core/src/qrcode/QRErrorCorrectionLevel.h +39 -0
- package/cpp/zxing-core/core/src/qrcode/QRFormatInformation.cpp +160 -0
- package/cpp/zxing-core/core/src/qrcode/QRFormatInformation.h +61 -0
- package/cpp/zxing-core/core/src/qrcode/QRMaskUtil.cpp +156 -0
- package/cpp/zxing-core/core/src/qrcode/QRMaskUtil.h +15 -0
- package/cpp/zxing-core/core/src/qrcode/QRMatrixUtil.cpp +318 -0
- package/cpp/zxing-core/core/src/qrcode/QRMatrixUtil.h +25 -0
- package/cpp/zxing-core/core/src/qrcode/QRReader.cpp +149 -0
- package/cpp/zxing-core/core/src/qrcode/QRReader.h +21 -0
- package/cpp/zxing-core/core/src/qrcode/QRVersion.cpp +754 -0
- package/cpp/zxing-core/core/src/qrcode/QRVersion.h +127 -0
- package/cpp/zxing-core/core/src/qrcode/QRWriter.cpp +51 -0
- package/cpp/zxing-core/core/src/qrcode/QRWriter.h +74 -0
- package/cpp/zxing-core/core/version.rc.in +34 -0
- package/cpp/zxing-core/core/zxing.pc.in +8 -0
- package/cpp/zxing-core/wrappers/ios/README.md +25 -0
- package/cpp/zxing-core/wrappers/ios/Sources/Wrapper/Version.h +29 -0
- package/cpp/zxing-core/zxing-cpp.podspec +45 -0
- package/lib/factory.d.ts +10 -0
- package/lib/factory.js +12 -0
- package/lib/index.d.ts +9 -0
- package/lib/index.js +9 -0
- package/lib/specs/Barcode.nitro.d.ts +63 -0
- package/lib/specs/Barcode.nitro.js +1 -0
- package/lib/specs/BarcodeFormat.d.ts +11 -0
- package/lib/specs/BarcodeFormat.js +1 -0
- package/lib/specs/BarcodeScanner.nitro.d.ts +89 -0
- package/lib/specs/BarcodeScanner.nitro.js +1 -0
- package/lib/specs/BarcodeScannerFactory.nitro.d.ts +26 -0
- package/lib/specs/BarcodeScannerFactory.nitro.js +1 -0
- package/lib/specs/BarcodeValueType.d.ts +9 -0
- package/lib/specs/BarcodeValueType.js +1 -0
- package/lib/specs/Point.d.ts +14 -0
- package/lib/specs/Point.js +1 -0
- package/lib/specs/Rect.d.ts +22 -0
- package/lib/specs/Rect.js +1 -0
- package/lib/useBarcodeScanner.d.ts +23 -0
- package/lib/useBarcodeScanner.js +25 -0
- package/nitro.json +20 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/VisionCameraZxing+autolinking.cmake +83 -0
- package/nitrogen/generated/android/VisionCameraZxing+autolinking.gradle +27 -0
- package/nitrogen/generated/android/VisionCameraZxingOnLoad.cpp +49 -0
- package/nitrogen/generated/android/VisionCameraZxingOnLoad.hpp +34 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/camera/zxing/VisionCameraZxingOnLoad.kt +35 -0
- package/nitrogen/generated/ios/VisionCameraZxing+autolinking.rb +62 -0
- package/nitrogen/generated/ios/VisionCameraZxing-Swift-Cxx-Bridge.cpp +17 -0
- package/nitrogen/generated/ios/VisionCameraZxing-Swift-Cxx-Bridge.hpp +27 -0
- package/nitrogen/generated/ios/VisionCameraZxing-Swift-Cxx-Umbrella.hpp +38 -0
- package/nitrogen/generated/ios/VisionCameraZxingAutolinking.mm +35 -0
- package/nitrogen/generated/ios/VisionCameraZxingAutolinking.swift +16 -0
- package/nitrogen/generated/shared/c++/BarcodeFormat.hpp +124 -0
- package/nitrogen/generated/shared/c++/BarcodeScannerOptions.hpp +85 -0
- package/nitrogen/generated/shared/c++/BarcodeValueType.hpp +120 -0
- package/nitrogen/generated/shared/c++/HybridBarcodeScannerSpec.cpp +23 -0
- package/nitrogen/generated/shared/c++/HybridBarcodeScannerSpec.hpp +74 -0
- package/nitrogen/generated/shared/c++/HybridBarcodeSpec.cpp +27 -0
- package/nitrogen/generated/shared/c++/HybridBarcodeSpec.hpp +82 -0
- package/nitrogen/generated/shared/c++/HybridZXingBarcodeScannerFactorySpec.cpp +21 -0
- package/nitrogen/generated/shared/c++/HybridZXingBarcodeScannerFactorySpec.hpp +67 -0
- package/nitrogen/generated/shared/c++/Point.hpp +87 -0
- package/nitrogen/generated/shared/c++/Rect.hpp +95 -0
- package/nitrogen/generated/shared/c++/TargetBarcodeFormat.hpp +124 -0
- package/package.json +108 -0
- package/react-native.config.js +16 -0
- package/src/factory.ts +26 -0
- package/src/index.ts +9 -0
- package/src/specs/Barcode.nitro.ts +70 -0
- package/src/specs/BarcodeFormat.ts +31 -0
- package/src/specs/BarcodeScanner.nitro.ts +91 -0
- package/src/specs/BarcodeScannerFactory.nitro.ts +27 -0
- package/src/specs/BarcodeValueType.ts +25 -0
- package/src/specs/Point.ts +14 -0
- package/src/specs/Rect.ts +22 -0
- package/src/useBarcodeScanner.ts +36 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Axel Waggershauser
|
|
3
|
+
*/
|
|
4
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
|
|
6
|
+
#include "ODDataBarLimitedReader.h"
|
|
7
|
+
|
|
8
|
+
#include "BarcodeFormat.h"
|
|
9
|
+
#include "GTIN.h"
|
|
10
|
+
#include "ODDataBarCommon.h"
|
|
11
|
+
#include "BarcodeData.h"
|
|
12
|
+
#include "SymbologyIdentifier.h"
|
|
13
|
+
|
|
14
|
+
#include <ranges>
|
|
15
|
+
|
|
16
|
+
//#define PRINT_DEBUG
|
|
17
|
+
#ifndef PRINT_DEBUG
|
|
18
|
+
#define printf(...){}
|
|
19
|
+
#define printv(...){}
|
|
20
|
+
#else
|
|
21
|
+
#define printv(fmt, ...) \
|
|
22
|
+
for (auto v : __VA_ARGS__) \
|
|
23
|
+
printf(fmt, v);
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
namespace ZXing::OneD {
|
|
27
|
+
|
|
28
|
+
using namespace DataBar;
|
|
29
|
+
|
|
30
|
+
constexpr int CHAR_LEN = 14;
|
|
31
|
+
constexpr int SYMBOL_LEN = 1 + 3 * CHAR_LEN + 2;
|
|
32
|
+
|
|
33
|
+
static Character ReadDataCharacter(const PatternView& view)
|
|
34
|
+
{
|
|
35
|
+
constexpr int G_SUM[] = {0, 183064, 820064, 1000776, 1491021, 1979845, 1996939};
|
|
36
|
+
constexpr int T_EVEN[] = {28, 728, 6454, 203, 2408, 1, 16632};
|
|
37
|
+
constexpr int ODD_SUM[] = {17, 13, 9, 15, 11, 19, 7};
|
|
38
|
+
constexpr int ODD_WIDEST[] = {6, 5, 3, 5, 4, 8, 1};
|
|
39
|
+
|
|
40
|
+
auto pattern = NormalizedPatternFromE2E<CHAR_LEN>(view, 26);
|
|
41
|
+
|
|
42
|
+
int checksum = 0;
|
|
43
|
+
for (int v : std::ranges::reverse_view(pattern))
|
|
44
|
+
checksum = 3 * checksum + v;
|
|
45
|
+
|
|
46
|
+
using Array7I = std::array<int, 7>;
|
|
47
|
+
Array7I oddPattern = {}, evnPattern = {};
|
|
48
|
+
OddEven<Array7I&> res = {oddPattern, evnPattern};
|
|
49
|
+
|
|
50
|
+
for (int i = 0; i < Size(pattern); ++i)
|
|
51
|
+
res[i % 2][i / 2] = pattern[i];
|
|
52
|
+
|
|
53
|
+
printf(" o: ");
|
|
54
|
+
printv("%d ", oddPattern);
|
|
55
|
+
printf(" e: ");
|
|
56
|
+
printv("%d ", evnPattern);
|
|
57
|
+
|
|
58
|
+
int group = IndexOf(ODD_SUM, Reduce(oddPattern));
|
|
59
|
+
if (group == -1)
|
|
60
|
+
return {};
|
|
61
|
+
|
|
62
|
+
int oddWidest = ODD_WIDEST[group];
|
|
63
|
+
int evnWidest = 9 - oddWidest;
|
|
64
|
+
int vOdd = GetValue(oddPattern, oddWidest, false);
|
|
65
|
+
int vEvn = GetValue(evnPattern, evnWidest, true);
|
|
66
|
+
int tEvn = T_EVEN[group];
|
|
67
|
+
int gSum = G_SUM[group];
|
|
68
|
+
|
|
69
|
+
return {vOdd * tEvn + vEvn + gSum, checksum};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
static std::string ConstructText(Character left, Character right)
|
|
73
|
+
{
|
|
74
|
+
auto symVal = 2'013'571LL * left.value + right.value;
|
|
75
|
+
|
|
76
|
+
// Strip 2D linkage flag (GS1 Composite) if any (ISO/IEC 24724:2011 Section 6.2.3)
|
|
77
|
+
if (symVal >= 2'015'133'531'096LL) {
|
|
78
|
+
symVal -= 2'015'133'531'096LL;
|
|
79
|
+
assert(symVal <= 1'999'999'999'999LL); // 13 digits
|
|
80
|
+
}
|
|
81
|
+
auto txt = ToString(symVal, 13);
|
|
82
|
+
return "01" + txt + GTIN::ComputeCheckDigit(txt);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
static inline bool Has26to18Ratio(int v26, int v18)
|
|
86
|
+
{
|
|
87
|
+
return v26 + 1.5 * v26 / 26 > v18 / 18. * 26. && v26 - 1.5 * v26 / 26 < v18 / 18. * 26.;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
std::array<int, 89> CheckChars = {
|
|
91
|
+
0b10'10101010'11100010, 0b10'10101010'01110010, 0b10'10101010'00111010, 0b10'10101001'01110010, 0b10'10101001'00111010,
|
|
92
|
+
0b10'10101000'10111010, 0b10'10100101'01110010, 0b10'10100101'00111010, 0b10'10100100'10111010, 0b10'10100010'10111010,
|
|
93
|
+
0b10'10010101'01110010, 0b10'10010101'00111010, 0b10'10010100'10111010, 0b10'10010010'10111010, 0b10'10001010'10111010,
|
|
94
|
+
0b10'01010101'01110010, 0b10'01010101'00111010, 0b10'01010100'10111010, 0b10'01010010'10111010, 0b10'01001010'10111010,
|
|
95
|
+
0b10'00101010'10111010, 0b10'10101011'01100010, 0b10'10101011'00110010, 0b10'10101011'00011010, 0b10'10101001'10110010,
|
|
96
|
+
0b10'10101001'10011010, 0b10'10101000'11011010, 0b10'10100101'10110010, 0b10'10100101'10011010, 0b10'10100100'11011010,
|
|
97
|
+
0b10'10100010'11011010, 0b10'10010101'10110010, 0b10'10010101'10011010, 0b10'10010100'11011010, 0b10'10010010'11011010,
|
|
98
|
+
0b10'10001010'11011010, 0b10'01010101'10110010, 0b10'01010101'10011010, 0b10'01010100'11011010, 0b10'01010010'11011010,
|
|
99
|
+
0b10'01001010'11011010, 0b10'00101010'11011010, 0b10'10101011'10100010, 0b10'10101011'10010010, 0b10'10101001'11010010,
|
|
100
|
+
0b10'10010101'11010010, 0b10'01010101'11010010, 0b10'10101101'01100010, 0b10'10101101'00110010, 0b10'10101101'00011010,
|
|
101
|
+
0b10'10101100'10110010, 0b10'10010110'10110010, 0b10'10010110'10011010, 0b10'10010110'01011010, 0b10'10010011'01011010,
|
|
102
|
+
0b10'10001011'01011010, 0b10'01010110'10110010, 0b10'01010110'10011010, 0b10'01001011'01011010, 0b10'10110101'01100010,
|
|
103
|
+
0b10'10110101'00110010, 0b10'10110101'00011010, 0b10'10110100'10110010, 0b10'10110100'10011010, 0b10'10110010'10110010,
|
|
104
|
+
0b10'01011010'10110010, 0b10'01011010'10011010, 0b10'01011010'01011010, 0b10'01011001'01011010, 0b10'01001101'01011010,
|
|
105
|
+
0b10'00101101'01011010, 0b10'11010101'01100010, 0b10'11010101'00110010, 0b10'11010101'00011010, 0b10'11010100'10110010,
|
|
106
|
+
0b10'11010100'10011010, 0b10'11010100'01011010, 0b10'11010010'10110010, 0b10'11010010'10011010, 0b10'11001010'10110010,
|
|
107
|
+
0b11'01010101'00110010, 0b11'01010101'00011010, 0b11'01010100'10110010, 0b11'01010100'10011010, 0b11'01010100'01011010,
|
|
108
|
+
0b11'01010010'10011010, 0b11'01010010'01011010, 0b11'01001010'10011010, 0b11'01010101'10010010,
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
BarcodeData DataBarLimitedReader::decodePattern(int rowNumber, PatternView& next, std::unique_ptr<RowReader::DecodingState>&) const
|
|
112
|
+
{
|
|
113
|
+
next = next.subView(-2, SYMBOL_LEN);
|
|
114
|
+
while (next.shift(2)) {
|
|
115
|
+
if (!IsGuard(next[27], next[43]))
|
|
116
|
+
continue;
|
|
117
|
+
auto spaceSize = (next[27] + next[43]) / 2;
|
|
118
|
+
if ((!next.isAtFirstBar() && next[-1] < spaceSize) || (!next.isAtLastBar() && next[SYMBOL_LEN] < 4 * spaceSize))
|
|
119
|
+
continue;
|
|
120
|
+
auto [mBar, MBar] = std::minmax({next[0], next[28], next[44]});
|
|
121
|
+
if (MBar > mBar * 4 / 3 + 1)
|
|
122
|
+
continue;
|
|
123
|
+
|
|
124
|
+
auto leftView = next.subView(1 + 0 * CHAR_LEN, CHAR_LEN);
|
|
125
|
+
auto checkView = next.subView(1 + 1 * CHAR_LEN, CHAR_LEN);
|
|
126
|
+
auto rightView = next.subView(1 + 2 * CHAR_LEN, CHAR_LEN);
|
|
127
|
+
auto leftWidth = leftView.sum();
|
|
128
|
+
auto checkWith = checkView.sum();
|
|
129
|
+
auto rightWidth = rightView.sum();
|
|
130
|
+
if (!Has26to18Ratio(leftWidth, checkWith) || !Has26to18Ratio(rightWidth, checkWith))
|
|
131
|
+
continue;
|
|
132
|
+
|
|
133
|
+
auto modSize = double(leftWidth + checkWith + rightWidth) / (26 + 18 + 26);
|
|
134
|
+
if ((!next.isAtFirstBar() && next[-1] < modSize) || (!next.isAtLastBar() && next[SYMBOL_LEN] < 5 * modSize))
|
|
135
|
+
continue;
|
|
136
|
+
|
|
137
|
+
auto checkCharPattern = ToInt(NormalizedPatternFromE2E<CHAR_LEN>(checkView, 18));
|
|
138
|
+
int checksum = IndexOf(CheckChars, checkCharPattern);
|
|
139
|
+
if (checksum == -1)
|
|
140
|
+
continue;
|
|
141
|
+
|
|
142
|
+
printf("%f - ", modSize);
|
|
143
|
+
printv("%d ", NormalizedPatternFromE2E<CHAR_LEN>(checkView, 18));
|
|
144
|
+
|
|
145
|
+
auto left = ReadDataCharacter(leftView);
|
|
146
|
+
auto right = ReadDataCharacter(rightView);
|
|
147
|
+
|
|
148
|
+
printf("- %d, %d, %d\n", checksum, left.value, right.value);
|
|
149
|
+
|
|
150
|
+
if (!left || !right || (left.checksum + 20 * right.checksum) % 89 != checksum)
|
|
151
|
+
continue;
|
|
152
|
+
|
|
153
|
+
return LinearBarcode(BarcodeFormat::DataBarLtd, ConstructText(left, right), rowNumber, next.pixelsInFront(),
|
|
154
|
+
next.pixelsTillEnd(), {'e', '0', 0, AIFlag::GS1});
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// guarantee progress (see loop in ODReader.cpp)
|
|
158
|
+
next = {};
|
|
159
|
+
|
|
160
|
+
return {};
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
} // namespace ZXing::OneD
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Axel Waggershauser
|
|
3
|
+
*/
|
|
4
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
|
|
6
|
+
#pragma once
|
|
7
|
+
|
|
8
|
+
#include "ODRowReader.h"
|
|
9
|
+
|
|
10
|
+
namespace ZXing::OneD {
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Decodes DataBarLimited symbols. See ISO/IEC 24724:2011.
|
|
14
|
+
*/
|
|
15
|
+
class DataBarLimitedReader : public RowReader
|
|
16
|
+
{
|
|
17
|
+
public:
|
|
18
|
+
using RowReader::RowReader;
|
|
19
|
+
|
|
20
|
+
BarcodeData decodePattern(int rowNumber, PatternView& next, std::unique_ptr<DecodingState>& state) const override;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
} // namespace ZXing::OneD
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2016 Nu-book Inc.
|
|
3
|
+
* Copyright 2016 ZXing authors
|
|
4
|
+
* Copyright 2020 Axel Waggershauser
|
|
5
|
+
*/
|
|
6
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
7
|
+
|
|
8
|
+
#include "ODDataBarReader.h"
|
|
9
|
+
|
|
10
|
+
#include "BarcodeFormat.h"
|
|
11
|
+
#include "DecoderResult.h"
|
|
12
|
+
#include "DetectorResult.h"
|
|
13
|
+
#include "GTIN.h"
|
|
14
|
+
#include "ODDataBarCommon.h"
|
|
15
|
+
#include "BarcodeData.h"
|
|
16
|
+
|
|
17
|
+
#include <cmath>
|
|
18
|
+
#include <ranges>
|
|
19
|
+
#include <unordered_set>
|
|
20
|
+
|
|
21
|
+
namespace ZXing::OneD {
|
|
22
|
+
|
|
23
|
+
using namespace DataBar;
|
|
24
|
+
|
|
25
|
+
static bool IsCharacterPair(PatternView v, int modsLeft, int modsRight)
|
|
26
|
+
{
|
|
27
|
+
float modSizeRef = ModSizeFinder(v);
|
|
28
|
+
return IsCharacter(LeftChar(v), modsLeft, modSizeRef) && IsCharacter(RightChar(v), modsRight, modSizeRef);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
static bool IsLeftPair(const PatternView& v)
|
|
32
|
+
{
|
|
33
|
+
return IsFinder(v[8], v[9], v[10], v[11], v[12]) && IsGuard(v[-1], v[11]) && IsCharacterPair(v, 16, 15);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
static bool IsRightPair(const PatternView& v)
|
|
37
|
+
{
|
|
38
|
+
return IsFinder(v[12], v[11], v[10], v[9], v[8]) && IsGuard(v[9], v[21]) && IsCharacterPair(v, 15, 16);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
static Character ReadDataCharacter(const PatternView& view, bool outsideChar, bool rightPair)
|
|
42
|
+
{
|
|
43
|
+
constexpr int OUTSIDE_EVEN_TOTAL_SUBSET[] = {1, 10, 34, 70, 126};
|
|
44
|
+
constexpr int INSIDE_ODD_TOTAL_SUBSET[] = {4, 20, 48, 81};
|
|
45
|
+
constexpr int OUTSIDE_GSUM[] = {0, 161, 961, 2015, 2715};
|
|
46
|
+
constexpr int INSIDE_GSUM[] = {0, 336, 1036, 1516};
|
|
47
|
+
constexpr int OUTSIDE_ODD_WIDEST[] = {8, 6, 4, 3, 1};
|
|
48
|
+
constexpr int INSIDE_ODD_WIDEST[] = {2, 4, 6, 8};
|
|
49
|
+
|
|
50
|
+
Array4I oddPattern = {}, evnPattern = {};
|
|
51
|
+
if (!ReadDataCharacterRaw(view, outsideChar ? 16 : 15, outsideChar == rightPair, oddPattern, evnPattern))
|
|
52
|
+
return {};
|
|
53
|
+
|
|
54
|
+
auto calcChecksumPortion = [](const Array4I& counts) {
|
|
55
|
+
int res = 0;
|
|
56
|
+
for (int count : std::ranges::reverse_view(counts))
|
|
57
|
+
res = 9 * res + count;
|
|
58
|
+
return res;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
int checksumPortion = calcChecksumPortion(oddPattern) + 3 * calcChecksumPortion(evnPattern);
|
|
62
|
+
|
|
63
|
+
if (outsideChar) {
|
|
64
|
+
int oddSum = Reduce(oddPattern);
|
|
65
|
+
assert((oddSum & 1) == 0 && oddSum <= 12 && oddSum >= 4); // checked in ReadDataCharacterRaw
|
|
66
|
+
int group = (12 - oddSum) / 2;
|
|
67
|
+
int oddWidest = OUTSIDE_ODD_WIDEST[group];
|
|
68
|
+
int evnWidest = 9 - oddWidest;
|
|
69
|
+
int vOdd = GetValue(oddPattern, oddWidest, false);
|
|
70
|
+
int vEvn = GetValue(evnPattern, evnWidest, true);
|
|
71
|
+
int tEvn = OUTSIDE_EVEN_TOTAL_SUBSET[group];
|
|
72
|
+
int gSum = OUTSIDE_GSUM[group];
|
|
73
|
+
return {vOdd * tEvn + vEvn + gSum, checksumPortion};
|
|
74
|
+
} else {
|
|
75
|
+
int evnSum = Reduce(evnPattern);
|
|
76
|
+
assert((evnSum & 1) == 0 && evnSum <= 12 && evnSum >= 4); // checked in ReadDataCharacterRaw
|
|
77
|
+
int group = (10 - evnSum) / 2;
|
|
78
|
+
int oddWidest = INSIDE_ODD_WIDEST[group];
|
|
79
|
+
int evnWidest = 9 - oddWidest;
|
|
80
|
+
int vOdd = GetValue(oddPattern, oddWidest, true);
|
|
81
|
+
int vEvn = GetValue(evnPattern, evnWidest, false);
|
|
82
|
+
int tOdd = INSIDE_ODD_TOTAL_SUBSET[group];
|
|
83
|
+
int gSum = INSIDE_GSUM[group];
|
|
84
|
+
return {vEvn * tOdd + vOdd + gSum, checksumPortion};
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
int ParseFinderPattern(const PatternView& view, bool reversed)
|
|
89
|
+
{
|
|
90
|
+
static constexpr std::array<Pattern<3>, 9> e2ePatterns = {{
|
|
91
|
+
{11, 10, 3 }, // {3, 8, 2, 1, 1}
|
|
92
|
+
{8 , 10, 6 }, // {3, 5, 5, 1, 1}
|
|
93
|
+
{6 , 10, 8 }, // {3, 3, 7, 1, 1}
|
|
94
|
+
{4 , 10, 10}, // {3, 1, 9, 1, 1}
|
|
95
|
+
{9 , 11, 5 }, // {2, 7, 4, 1, 1}
|
|
96
|
+
{7 , 11, 7 }, // {2, 5, 6, 1, 1}
|
|
97
|
+
{5 , 11, 9 }, // {2, 3, 8, 1, 1}
|
|
98
|
+
{6 , 11, 8 }, // {1, 5, 7, 1, 1}
|
|
99
|
+
{4 , 12, 10}, // {1, 3, 9, 1, 1}
|
|
100
|
+
}};
|
|
101
|
+
|
|
102
|
+
return ParseFinderPattern(view, reversed, e2ePatterns);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
static Pair ReadPair(const PatternView& view, bool rightPair)
|
|
106
|
+
{
|
|
107
|
+
if (int pattern = ParseFinderPattern(Finder(view), rightPair))
|
|
108
|
+
if (auto outside = ReadDataCharacter(rightPair ? RightChar(view) : LeftChar(view), true, rightPair))
|
|
109
|
+
if (auto inside = ReadDataCharacter(rightPair ? LeftChar(view) : RightChar(view), false, rightPair)) {
|
|
110
|
+
// include left and right guards
|
|
111
|
+
int xStart = view.pixelsInFront() - view[-1];
|
|
112
|
+
int xStop = view.pixelsTillEnd() + 2 * view[FULL_PAIR_SIZE];
|
|
113
|
+
return {outside, inside, pattern, xStart, xStop};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return {};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
static long long Value(Pair leftPair, Pair rightPair)
|
|
120
|
+
{
|
|
121
|
+
auto value = [](Pair p) { return 1597 * p.left.value + p.right.value; };
|
|
122
|
+
auto res = 4537077LL * value(leftPair) + value(rightPair);
|
|
123
|
+
if (res >= 10000000000000LL) { // Strip 2D linkage flag (GS1 Composite) if any (ISO/IEC 24724:2011 Section 5.2.3)
|
|
124
|
+
res -= 10000000000000LL;
|
|
125
|
+
}
|
|
126
|
+
return res;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
static bool ChecksumIsValid(Pair leftPair, Pair rightPair)
|
|
130
|
+
{
|
|
131
|
+
auto checksum = [](Pair p) { return p.left.checksum + 4 * p.right.checksum; };
|
|
132
|
+
int a = (checksum(leftPair) + 16 * checksum(rightPair)) % 79;
|
|
133
|
+
int b = 9 * (std::abs(leftPair.finder) - 1) + (std::abs(rightPair.finder) - 1);
|
|
134
|
+
if (b > 72)
|
|
135
|
+
b--;
|
|
136
|
+
if (b > 8)
|
|
137
|
+
b--;
|
|
138
|
+
return a == b && Value(leftPair, rightPair) <= 9999999999999LL; // 13 digits
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
static bool PositionIsPlausible(const Pair& l, const Pair& r)
|
|
142
|
+
{
|
|
143
|
+
int wl = l.xStop - l.xStart;
|
|
144
|
+
int wr = r.xStop - r.xStart;
|
|
145
|
+
int h = std::abs(l.y - r.y);
|
|
146
|
+
int dxl = std::abs(l.xStart - r.xStart);
|
|
147
|
+
int dxr = std::abs(l.xStop - r.xStart);
|
|
148
|
+
|
|
149
|
+
// - the pairs must be wider than the stack is high
|
|
150
|
+
// - the pairs must be roughly of the same width
|
|
151
|
+
// - the pairs x positions must be sufficiently aligned (i.e. the stack is not too slanted)
|
|
152
|
+
return h < wl && h < wr && wl > wr / 2 && wr > wl / 2 && (dxl < wl / 2 || dxr < wr / 2);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
static std::string ConstructText(const Pair& leftPair, const Pair& rightPair)
|
|
156
|
+
{
|
|
157
|
+
auto txt = ToString(Value(leftPair, rightPair), 13);
|
|
158
|
+
// see ISO/IEC 24724:2011 Section 9
|
|
159
|
+
return "01" + txt + GTIN::ComputeCheckDigit(txt);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
struct State : public RowReader::DecodingState
|
|
163
|
+
{
|
|
164
|
+
std::unordered_set<Pair, PairHash> leftPairs;
|
|
165
|
+
std::unordered_set<Pair, PairHash> rightPairs;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
BarcodeData DataBarReader::decodePattern(int rowNumber, PatternView& next, std::unique_ptr<RowReader::DecodingState>& state) const
|
|
169
|
+
{
|
|
170
|
+
if (!state)
|
|
171
|
+
state = std::make_unique<State>();
|
|
172
|
+
auto* prevState = static_cast<State*>(state.get());
|
|
173
|
+
|
|
174
|
+
if (_opts.hasFormat(BarcodeFormat::DataBarOmni) && !_opts.hasFormat(BarcodeFormat::DataBar) && !_opts.tryHarder()) {
|
|
175
|
+
// non-stacked version
|
|
176
|
+
(void)state;
|
|
177
|
+
next = next.subView(-1, FULL_PAIR_SIZE + 1); // +1 reflects the guard pattern on the right, see IsRightPair());
|
|
178
|
+
// yes: the first view we test is at index 1 (black bar at 0 would be the guard pattern)
|
|
179
|
+
while (next.shift(2)) {
|
|
180
|
+
if (IsLeftPair(next)) {
|
|
181
|
+
if (auto leftPair = ReadPair(next, false); leftPair && next.shift(FULL_PAIR_SIZE) && IsRightPair(next)) {
|
|
182
|
+
if (auto rightPair = ReadPair(next, true); rightPair && ChecksumIsValid(leftPair, rightPair)) {
|
|
183
|
+
return LinearBarcode(BarcodeFormat::DataBarOmni, ConstructText(leftPair, rightPair), rowNumber, leftPair.xStart,
|
|
184
|
+
rightPair.xStop, {'e', '0', 0, AIFlag::GS1});
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
goto out;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
next = next.subView(0, FULL_PAIR_SIZE + 1); // +1 reflects the guard pattern on the right, see IsRightPair()
|
|
194
|
+
// yes: the first view we test is at index 1 (black bar at 0 would be the guard pattern)
|
|
195
|
+
while (next.shift(1)) {
|
|
196
|
+
if (IsLeftPair(next)) {
|
|
197
|
+
if (auto leftPair = ReadPair(next, false)) {
|
|
198
|
+
leftPair.y = rowNumber;
|
|
199
|
+
auto [it, inserted] = prevState->leftPairs.insert(leftPair);
|
|
200
|
+
if (!inserted)
|
|
201
|
+
const_cast<Pair&>(*it).count++;
|
|
202
|
+
next.shift(FULL_PAIR_SIZE - 1);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
if (next.shift(1) && IsRightPair(next)) {
|
|
207
|
+
if (auto rightPair = ReadPair(next, true)) {
|
|
208
|
+
rightPair.y = rowNumber;
|
|
209
|
+
auto [it, inserted] = prevState->rightPairs.insert(rightPair);
|
|
210
|
+
if (!inserted)
|
|
211
|
+
const_cast<Pair&>(*it).count++;
|
|
212
|
+
next.shift(FULL_PAIR_SIZE + 2);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
for (const auto& leftPair : prevState->leftPairs)
|
|
218
|
+
for (const auto& rightPair : prevState->rightPairs)
|
|
219
|
+
if (ChecksumIsValid(leftPair, rightPair) && PositionIsPlausible(leftPair, rightPair) && leftPair.count > 1
|
|
220
|
+
&& rightPair.count > 1) {
|
|
221
|
+
// Symbology identifier ISO/IEC 24724:2011 Section 9 and GS1 General Specifications 5.1.3 Figure 5.1.3-2
|
|
222
|
+
auto res = BarcodeData{.content = Content(ByteArray{ConstructText(leftPair, rightPair)}, {'e', '0', 0, AIFlag::GS1}),
|
|
223
|
+
.position = EstimatePosition(leftPair, rightPair),
|
|
224
|
+
.format = leftPair.center() < rightPair.xStart ? BarcodeFormat::DataBarOmni
|
|
225
|
+
: BarcodeFormat::DataBarStk,
|
|
226
|
+
.lineCount = EstimateLineCount(leftPair, rightPair)};
|
|
227
|
+
|
|
228
|
+
prevState->leftPairs.erase(leftPair);
|
|
229
|
+
prevState->rightPairs.erase(rightPair);
|
|
230
|
+
return res;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
out:
|
|
234
|
+
// guarantee progress (see loop in ODReader.cpp)
|
|
235
|
+
next = {};
|
|
236
|
+
|
|
237
|
+
return {};
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
} // namespace ZXing::OneD
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2016 Nu-book Inc.
|
|
3
|
+
* Copyright 2016 ZXing authors
|
|
4
|
+
* Copyright 2020 Axel Waggershauser
|
|
5
|
+
*/
|
|
6
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "ODRowReader.h"
|
|
11
|
+
|
|
12
|
+
namespace ZXing::OneD {
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Decodes DataBar (formerly known as RSS) symbols, including truncated and stacked variants. See ISO/IEC 24724:2006.
|
|
16
|
+
*/
|
|
17
|
+
class DataBarReader : public RowReader
|
|
18
|
+
{
|
|
19
|
+
public:
|
|
20
|
+
using RowReader::RowReader;
|
|
21
|
+
|
|
22
|
+
BarcodeData decodePattern(int rowNumber, PatternView& next, std::unique_ptr<DecodingState>& state) const override;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
} // namespace ZXing::OneD
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2016 Huy Cuong Nguyen
|
|
3
|
+
* Copyright 2016 ZXing authors
|
|
4
|
+
*/
|
|
5
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
|
|
7
|
+
#include "ODEAN13Writer.h"
|
|
8
|
+
|
|
9
|
+
#include "ODUPCEANCommon.h"
|
|
10
|
+
#include "ODWriterHelper.h"
|
|
11
|
+
#include "Utf.h"
|
|
12
|
+
|
|
13
|
+
#include <array>
|
|
14
|
+
#include <vector>
|
|
15
|
+
|
|
16
|
+
namespace ZXing::OneD {
|
|
17
|
+
|
|
18
|
+
static const int FIRST_DIGIT_ENCODINGS[] = {
|
|
19
|
+
0x00, 0x0B, 0x0D, 0xE, 0x13, 0x19, 0x1C, 0x15, 0x16, 0x1A
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
static const int CODE_WIDTH = 3 + // start guard
|
|
23
|
+
(7 * 6) + // left bars
|
|
24
|
+
5 + // middle guard
|
|
25
|
+
(7 * 6) + // right bars
|
|
26
|
+
3; // end guard
|
|
27
|
+
|
|
28
|
+
BitMatrix
|
|
29
|
+
EAN13Writer::encode(const std::wstring& contents, int width, int height) const
|
|
30
|
+
{
|
|
31
|
+
auto digits = UPCEANCommon::DigitString2IntArray<13>(contents);
|
|
32
|
+
|
|
33
|
+
int parities = FIRST_DIGIT_ENCODINGS[digits[0]];
|
|
34
|
+
std::vector<bool> result(CODE_WIDTH, false);
|
|
35
|
+
int pos = 0;
|
|
36
|
+
|
|
37
|
+
pos += WriterHelper::AppendPattern(result, pos, UPCEANCommon::START_END_PATTERN, true);
|
|
38
|
+
|
|
39
|
+
// See {@link #EAN13Reader} for a description of how the first digit & left bars are encoded
|
|
40
|
+
for (int i = 1; i <= 6; i++) {
|
|
41
|
+
int digit = digits[i];
|
|
42
|
+
if ((parities >> (6 - i) & 1) == 1) {
|
|
43
|
+
digit += 10;
|
|
44
|
+
}
|
|
45
|
+
pos += WriterHelper::AppendPattern(result, pos, UPCEANCommon::L_AND_G_PATTERNS[digit], false);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
pos += WriterHelper::AppendPattern(result, pos, UPCEANCommon::MIDDLE_PATTERN, false);
|
|
49
|
+
|
|
50
|
+
for (int i = 7; i <= 12; i++) {
|
|
51
|
+
pos += WriterHelper::AppendPattern(result, pos, UPCEANCommon::L_PATTERNS[digits[i]], true);
|
|
52
|
+
}
|
|
53
|
+
WriterHelper::AppendPattern(result, pos, UPCEANCommon::START_END_PATTERN, true);
|
|
54
|
+
return WriterHelper::RenderResult(result, width, height, _sidesMargin >= 0 ? _sidesMargin : 9);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
BitMatrix EAN13Writer::encode(const std::string& contents, int width, int height) const
|
|
58
|
+
{
|
|
59
|
+
return encode(FromUtf8(contents), width, height);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
} // namespace ZXing::OneD
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2016 Huy Cuong Nguyen
|
|
3
|
+
* Copyright 2016 ZXing authors
|
|
4
|
+
*/
|
|
5
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
|
|
7
|
+
#pragma once
|
|
8
|
+
|
|
9
|
+
#include <string>
|
|
10
|
+
|
|
11
|
+
namespace ZXing {
|
|
12
|
+
|
|
13
|
+
class BitMatrix;
|
|
14
|
+
|
|
15
|
+
namespace OneD {
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* This object renders an EAN8 code as a {@link BitMatrix}.
|
|
19
|
+
*
|
|
20
|
+
* @author aripollak@gmail.com (Ari Pollak)
|
|
21
|
+
*/
|
|
22
|
+
class EAN13Writer
|
|
23
|
+
{
|
|
24
|
+
public:
|
|
25
|
+
EAN13Writer& setMargin(int sidesMargin) { _sidesMargin = sidesMargin; return *this; }
|
|
26
|
+
BitMatrix encode(const std::wstring& contents, int width, int height) const;
|
|
27
|
+
BitMatrix encode(const std::string& contents, int width, int height) const;
|
|
28
|
+
|
|
29
|
+
private:
|
|
30
|
+
int _sidesMargin = -1;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
} // OneD
|
|
34
|
+
} // ZXing
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2016 Huy Cuong Nguyen
|
|
3
|
+
* Copyright 2016 ZXing authors
|
|
4
|
+
*/
|
|
5
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
|
|
7
|
+
#include "ODEAN8Writer.h"
|
|
8
|
+
|
|
9
|
+
#include "ODUPCEANCommon.h"
|
|
10
|
+
#include "ODWriterHelper.h"
|
|
11
|
+
#include "Utf.h"
|
|
12
|
+
|
|
13
|
+
#include <vector>
|
|
14
|
+
|
|
15
|
+
namespace ZXing::OneD {
|
|
16
|
+
|
|
17
|
+
static const int CODE_WIDTH = 3 + // start guard
|
|
18
|
+
(7 * 4) + // left bars
|
|
19
|
+
5 + // middle guard
|
|
20
|
+
(7 * 4) + // right bars
|
|
21
|
+
3; // end guard
|
|
22
|
+
|
|
23
|
+
BitMatrix
|
|
24
|
+
EAN8Writer::encode(const std::wstring& contents, int width, int height) const
|
|
25
|
+
{
|
|
26
|
+
auto digits = UPCEANCommon::DigitString2IntArray<8>(contents);
|
|
27
|
+
|
|
28
|
+
std::vector<bool> result(CODE_WIDTH, false);
|
|
29
|
+
int pos = 0;
|
|
30
|
+
|
|
31
|
+
pos += WriterHelper::AppendPattern(result, pos, UPCEANCommon::START_END_PATTERN, true);
|
|
32
|
+
|
|
33
|
+
for (int i = 0; i <= 3; i++) {
|
|
34
|
+
pos += WriterHelper::AppendPattern(result, pos, UPCEANCommon::L_PATTERNS[digits[i]], false);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
pos += WriterHelper::AppendPattern(result, pos, UPCEANCommon::MIDDLE_PATTERN, false);
|
|
38
|
+
|
|
39
|
+
for (int i = 4; i <= 7; i++) {
|
|
40
|
+
pos += WriterHelper::AppendPattern(result, pos, UPCEANCommon::L_PATTERNS[digits[i]], true);
|
|
41
|
+
}
|
|
42
|
+
WriterHelper::AppendPattern(result, pos, UPCEANCommon::START_END_PATTERN, true);
|
|
43
|
+
return WriterHelper::RenderResult(result, width, height, _sidesMargin >= 0 ? _sidesMargin : 9);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
BitMatrix EAN8Writer::encode(const std::string& contents, int width, int height) const
|
|
47
|
+
{
|
|
48
|
+
return encode(FromUtf8(contents), width, height);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
} // namespace ZXing::OneD
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2016 Huy Cuong Nguyen
|
|
3
|
+
* Copyright 2016 ZXing authors
|
|
4
|
+
*/
|
|
5
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
|
|
7
|
+
#pragma once
|
|
8
|
+
|
|
9
|
+
#include <string>
|
|
10
|
+
|
|
11
|
+
namespace ZXing {
|
|
12
|
+
|
|
13
|
+
class BitMatrix;
|
|
14
|
+
|
|
15
|
+
namespace OneD {
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* This object renders an EAN8 code as a {@link BitMatrix}.
|
|
19
|
+
*
|
|
20
|
+
* @author aripollak@gmail.com (Ari Pollak)
|
|
21
|
+
*/
|
|
22
|
+
class EAN8Writer
|
|
23
|
+
{
|
|
24
|
+
public:
|
|
25
|
+
EAN8Writer& setMargin(int sidesMargin) { _sidesMargin = sidesMargin; return *this; }
|
|
26
|
+
BitMatrix encode(const std::wstring& contents, int width, int height) const;
|
|
27
|
+
BitMatrix encode(const std::string& contents, int width, int height) const;
|
|
28
|
+
|
|
29
|
+
private:
|
|
30
|
+
int _sidesMargin = -1;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
} // OneD
|
|
34
|
+
} // ZXing
|