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,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Axel Waggershauser
|
|
3
|
+
*/
|
|
4
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
|
|
6
|
+
#pragma once
|
|
7
|
+
|
|
8
|
+
#include "Reader.h"
|
|
9
|
+
|
|
10
|
+
namespace ZXing::MicroPdf417 {
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* This implementation can detect and decode Micro PDF417 codes in an image.
|
|
14
|
+
*/
|
|
15
|
+
class Reader : public ZXing::Reader
|
|
16
|
+
{
|
|
17
|
+
public:
|
|
18
|
+
using ZXing::Reader::Reader;
|
|
19
|
+
|
|
20
|
+
BarcodesData read(const BinaryBitmap& image, int maxSymbols) const override;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
} // namespace ZXing::MicroPdf417
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Axel Waggershauser
|
|
3
|
+
*/
|
|
4
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
|
|
6
|
+
#include "PDF417.h"
|
|
7
|
+
|
|
8
|
+
#include "LogMatrix.h"
|
|
9
|
+
#include "PDFCodewordDecoder.h"
|
|
10
|
+
|
|
11
|
+
namespace ZXing::PDF417 {
|
|
12
|
+
|
|
13
|
+
#if 0
|
|
14
|
+
// upstream PDF417 PatternView -> codeword implementation (uses "pick the closest pattern" approach and is worse than the below implementation)
|
|
15
|
+
using Pattern417I = std::array<int, Pdf417::CodewordDecoder::BARS_IN_MODULE>;
|
|
16
|
+
static Pattern417I GetPdf417PatternFromBits(uint32_t value)
|
|
17
|
+
{
|
|
18
|
+
Pattern417I result{};
|
|
19
|
+
for (int i = 7; i >= 0; --i)
|
|
20
|
+
value >>= (result[i] = std::countr_one(value) + std::countr_zero(value));
|
|
21
|
+
return result;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
Codeword ReadCodeword(BitMatrixModuleCursorF& cur)
|
|
25
|
+
{
|
|
26
|
+
auto pattern = cur.template readPatternFromBlack<Pattern417I>(cur.ms / 2, cur.ms * (17 + MS_THR), cur.ms * (17 - MS_THR));
|
|
27
|
+
auto symbol = Pdf417::CodewordDecoder::GetDecodedValue(pattern);
|
|
28
|
+
int cluster = CodewordCluster(GetPdf417PatternFromBits(symbol));
|
|
29
|
+
int codeword = Pdf417::CodewordDecoder::GetCodeword(symbol);
|
|
30
|
+
return {cluster, codeword};
|
|
31
|
+
}
|
|
32
|
+
#else
|
|
33
|
+
Codeword ReadCodeword(BitMatrixModuleCursorF& cur)
|
|
34
|
+
{
|
|
35
|
+
auto start = cur.p;
|
|
36
|
+
auto pattern = cur.template readPatternFromBlack<Pattern417>(cur.ms / 2, cur.ms * (17 + MS_THR), cur.ms * (17 - MS_THR));
|
|
37
|
+
auto np = NormalizedPattern<8, 17>(pattern);
|
|
38
|
+
int cluster = CodewordCluster(np);
|
|
39
|
+
#if 0
|
|
40
|
+
int codeword = Pdf417::CodewordDecoder::GetCodeword(ToInt(np));
|
|
41
|
+
#else
|
|
42
|
+
int codeword = Pdf417::CodewordDecoder::GetCodeword(NormalizedE2EPattern<8, 17>(pattern));
|
|
43
|
+
#endif
|
|
44
|
+
return {codeword, cluster, 1, PointT<float>(start), PointT<float>(cur.p)};
|
|
45
|
+
}
|
|
46
|
+
#endif
|
|
47
|
+
|
|
48
|
+
Codeword ReadCodeword(BitMatrixModuleCursorF& cur, int expectedCluster)
|
|
49
|
+
{
|
|
50
|
+
log(cur.p, 4);
|
|
51
|
+
auto start = cur;
|
|
52
|
+
auto cw = ReadCodeword(cur);
|
|
53
|
+
if (!cw || cw.cluster != expectedCluster) {
|
|
54
|
+
for (auto offset : {start.left(), start.right()}) {
|
|
55
|
+
auto curAlt = start.movedBy(cur.ms / 2 * offset);
|
|
56
|
+
if (auto cwAlt = ReadCodeword(curAlt)) {
|
|
57
|
+
if (!cw || cwAlt.cluster == expectedCluster) {
|
|
58
|
+
cw = cwAlt;
|
|
59
|
+
if (cwAlt.cluster == expectedCluster)
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (cw)
|
|
66
|
+
cur.ms = dot(cur.p - start.p, mainDirection(cur.d)) / 17.f;
|
|
67
|
+
printf("%3d/%d, ms: %.1f, @ %5.1fx%5.1f | ", cw.codeword, cw.cluster, cur.ms, cur.p.x, cur.p.y);
|
|
68
|
+
|
|
69
|
+
return cw;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
bool SkipCodeword(BitMatrixModuleCursorF& cur)
|
|
73
|
+
{
|
|
74
|
+
int min = cur.ms * (17 - MS_THR), max = cur.ms * (17 + MS_THR);
|
|
75
|
+
int steps = cur.stepToEdge(8, max);
|
|
76
|
+
int totalSteps = steps;
|
|
77
|
+
while (totalSteps < min && steps) {
|
|
78
|
+
steps = cur.stepToEdge(2, max - totalSteps);
|
|
79
|
+
totalSteps += steps;
|
|
80
|
+
}
|
|
81
|
+
cur.ms = totalSteps / 17.f;
|
|
82
|
+
return totalSteps >= min && max > 0;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
} // namespace ZXing::PDF417
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Axel Waggershauser
|
|
3
|
+
*/
|
|
4
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
|
|
6
|
+
#pragma once
|
|
7
|
+
|
|
8
|
+
#include "BitMatrixCursor.h"
|
|
9
|
+
#include "Pattern.h"
|
|
10
|
+
#include "Point.h"
|
|
11
|
+
#include "ZXAlgorithms.h"
|
|
12
|
+
|
|
13
|
+
#ifndef PRINT_DEBUG
|
|
14
|
+
#define printf(...){}
|
|
15
|
+
#define printv(...){}
|
|
16
|
+
#else
|
|
17
|
+
#define printv(prefix, fmt, postfix, ...) \
|
|
18
|
+
printf("%s", prefix); \
|
|
19
|
+
for (auto v : __VA_ARGS__) \
|
|
20
|
+
printf(fmt, v); \
|
|
21
|
+
printf("%s", postfix);
|
|
22
|
+
#endif
|
|
23
|
+
|
|
24
|
+
namespace ZXing::PDF417 {
|
|
25
|
+
|
|
26
|
+
constexpr int MS_THR = 2; // tolerance of pattern size in modules
|
|
27
|
+
|
|
28
|
+
using Pattern417 = std::array<uint16_t, 8>;
|
|
29
|
+
|
|
30
|
+
struct Codeword
|
|
31
|
+
{
|
|
32
|
+
int codeword : 12 = -1;
|
|
33
|
+
int cluster : 4 = -1;
|
|
34
|
+
int count : 16 = 0;
|
|
35
|
+
PointT<float> left, right;
|
|
36
|
+
|
|
37
|
+
constexpr operator bool() const noexcept { return codeword != -1 && cluster % 3 == 0; }
|
|
38
|
+
constexpr bool operator==(const Codeword& other) const noexcept { return codeword == other.codeword; }
|
|
39
|
+
PointF leftPos() const noexcept { return PointF(left / count); }
|
|
40
|
+
PointF rightPos() const noexcept { return PointF(right / count); }
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
struct CodewordPattern
|
|
44
|
+
{
|
|
45
|
+
int codeword : 11 = 0; // 11 is enough for [-1..929)
|
|
46
|
+
unsigned bits : 7 * 3 = 0; // 6/7 slots of 3 bits each for the normalized e2e pattern
|
|
47
|
+
|
|
48
|
+
constexpr bool operator<(const CodewordPattern& other) const noexcept { return bits < other.bits; }
|
|
49
|
+
constexpr int pattern(int i) const noexcept { return (bits >> ((6 - i - 1) * 3)) & 0b111; }
|
|
50
|
+
constexpr int cluster() const noexcept { return (pattern(0) - pattern(1) + pattern(4) - pattern(5) + 9) % 9; }
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
constexpr int CodewordCluster(const std::array<int, 8>& np)
|
|
54
|
+
{
|
|
55
|
+
return (np[0] - np[2] + np[4] - np[6] + 9) % 9;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
constexpr int CodewordCluster(const std::array<int, 6>& np)
|
|
59
|
+
{
|
|
60
|
+
return (np[0] - np[1] + np[4] - np[5] + 9) % 9;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
template <typename POINT>
|
|
64
|
+
class BitMatrixModuleCursor : public BitMatrixCursor<POINT>
|
|
65
|
+
{
|
|
66
|
+
public:
|
|
67
|
+
float ms;
|
|
68
|
+
|
|
69
|
+
BitMatrixModuleCursor(const BitMatrix& image, POINT p, POINT d, float ms) : BitMatrixCursor<POINT>(image, p, d), ms(ms) {}
|
|
70
|
+
|
|
71
|
+
BitMatrixModuleCursor movedBy(POINT o) const noexcept { return {*this->img, this->p + o, this->d, ms}; }
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
using BitMatrixModuleCursorF = BitMatrixModuleCursor<PointF>;
|
|
75
|
+
|
|
76
|
+
Codeword ReadCodeword(BitMatrixModuleCursorF& cur);
|
|
77
|
+
Codeword ReadCodeword(BitMatrixModuleCursorF& cur, int expectedCluster);
|
|
78
|
+
|
|
79
|
+
bool SkipCodeword(BitMatrixModuleCursorF& cur);
|
|
80
|
+
|
|
81
|
+
} // namespace ZXing::PDF417
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2016 Nu-book Inc.
|
|
3
|
+
* Copyright 2016 ZXing authors
|
|
4
|
+
*/
|
|
5
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
|
|
7
|
+
#pragma once
|
|
8
|
+
|
|
9
|
+
namespace ZXing {
|
|
10
|
+
namespace Pdf417 {
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @author Guenther Grau
|
|
14
|
+
*/
|
|
15
|
+
class BarcodeMetadata
|
|
16
|
+
{
|
|
17
|
+
int _columnCount = 0;
|
|
18
|
+
int _errorCorrectionLevel = 0;
|
|
19
|
+
int _rowCountUpperPart = 0;
|
|
20
|
+
int _rowCountLowerPart = 0;
|
|
21
|
+
|
|
22
|
+
public:
|
|
23
|
+
BarcodeMetadata() = default;
|
|
24
|
+
BarcodeMetadata(int columnCount, int rowCountUpperPart, int rowCountLowerPart, int errorCorrectionLevel)
|
|
25
|
+
: _columnCount(columnCount), _errorCorrectionLevel(errorCorrectionLevel), _rowCountUpperPart(rowCountUpperPart),
|
|
26
|
+
_rowCountLowerPart(rowCountLowerPart)
|
|
27
|
+
{
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
int columnCount() const {
|
|
31
|
+
return _columnCount;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
int errorCorrectionLevel() const {
|
|
35
|
+
return _errorCorrectionLevel;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
int rowCount() const {
|
|
39
|
+
return _rowCountUpperPart + _rowCountLowerPart;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
int rowCountUpperPart() const {
|
|
43
|
+
return _rowCountUpperPart;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
int rowCountLowerPart() const {
|
|
47
|
+
return _rowCountLowerPart;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
} // Pdf417
|
|
53
|
+
} // ZXing
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2016 Nu-book Inc.
|
|
3
|
+
* Copyright 2016 ZXing authors
|
|
4
|
+
*/
|
|
5
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
|
|
7
|
+
#include "PDFBarcodeValue.h"
|
|
8
|
+
|
|
9
|
+
#include <algorithm>
|
|
10
|
+
|
|
11
|
+
namespace ZXing {
|
|
12
|
+
namespace Pdf417 {
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Add an occurrence of a value
|
|
16
|
+
*/
|
|
17
|
+
void
|
|
18
|
+
BarcodeValue::setValue(int value)
|
|
19
|
+
{
|
|
20
|
+
_values[value] += 1;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Determines the maximum occurrence of a set value and returns all values which were set with this occurrence.
|
|
25
|
+
* @return an array of int, containing the values with the highest occurrence, or null, if no value was set
|
|
26
|
+
*/
|
|
27
|
+
std::vector<int>
|
|
28
|
+
BarcodeValue::value() const
|
|
29
|
+
{
|
|
30
|
+
std::vector<int> result;
|
|
31
|
+
if (!_values.empty()) {
|
|
32
|
+
int maxConfidence = std::max_element(_values.begin(), _values.end(), [](auto& l, auto& r) { return l.second < r.second; })->second;
|
|
33
|
+
for (auto [value, count] : _values)
|
|
34
|
+
if (count == maxConfidence)
|
|
35
|
+
result.push_back(value);
|
|
36
|
+
}
|
|
37
|
+
return result;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
int
|
|
41
|
+
BarcodeValue::confidence(int value) const
|
|
42
|
+
{
|
|
43
|
+
auto it = _values.find(value);
|
|
44
|
+
return it != _values.end() ? it->second : 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
} // Pdf417
|
|
48
|
+
} // ZXing
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2016 Nu-book Inc.
|
|
3
|
+
* Copyright 2016 ZXing authors
|
|
4
|
+
*/
|
|
5
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
|
|
7
|
+
#pragma once
|
|
8
|
+
|
|
9
|
+
#include <map>
|
|
10
|
+
#include <vector>
|
|
11
|
+
|
|
12
|
+
namespace ZXing {
|
|
13
|
+
namespace Pdf417 {
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @author Guenther Grau
|
|
17
|
+
*/
|
|
18
|
+
class BarcodeValue
|
|
19
|
+
{
|
|
20
|
+
std::map<int, int> _values;
|
|
21
|
+
|
|
22
|
+
public:
|
|
23
|
+
/**
|
|
24
|
+
* Add an occurrence of a value
|
|
25
|
+
*/
|
|
26
|
+
void setValue(int value);
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Determines the maximum occurrence of a set value and returns all values which were set with this occurrence.
|
|
30
|
+
* @return an array of int, containing the values with the highest occurrence, or null, if no value was set
|
|
31
|
+
*/
|
|
32
|
+
std::vector<int> value() const;
|
|
33
|
+
|
|
34
|
+
int confidence(int value) const;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
} // Pdf417
|
|
38
|
+
} // ZXing
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2016 Nu-book Inc.
|
|
3
|
+
* Copyright 2016 ZXing authors
|
|
4
|
+
*/
|
|
5
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
|
|
7
|
+
#include "PDFBoundingBox.h"
|
|
8
|
+
|
|
9
|
+
#include <algorithm>
|
|
10
|
+
|
|
11
|
+
namespace ZXing {
|
|
12
|
+
namespace Pdf417 {
|
|
13
|
+
|
|
14
|
+
BoundingBox::BoundingBox() {
|
|
15
|
+
_imgWidth = _imgHeight = _minX = _maxX = _minY = _maxY = 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
bool
|
|
19
|
+
BoundingBox::Create(int imgWidth, int imgHeight, const Nullable<ResultPoint>& topLeft, const Nullable<ResultPoint>& bottomLeft, const Nullable<ResultPoint>& topRight, const Nullable<ResultPoint>& bottomRight, BoundingBox& result)
|
|
20
|
+
{
|
|
21
|
+
if ((topLeft == nullptr && topRight == nullptr) ||
|
|
22
|
+
(bottomLeft == nullptr && bottomRight == nullptr) ||
|
|
23
|
+
(topLeft != nullptr && bottomLeft == nullptr) ||
|
|
24
|
+
(topRight != nullptr && bottomRight == nullptr)) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
result._imgWidth = imgWidth;
|
|
28
|
+
result._imgHeight = imgHeight;
|
|
29
|
+
result._topLeft = topLeft;
|
|
30
|
+
result._bottomLeft = bottomLeft;
|
|
31
|
+
result._topRight = topRight;
|
|
32
|
+
result._bottomRight = bottomRight;
|
|
33
|
+
result.calculateMinMaxValues();
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
void
|
|
38
|
+
BoundingBox::calculateMinMaxValues()
|
|
39
|
+
{
|
|
40
|
+
if (_topLeft == nullptr) {
|
|
41
|
+
_topLeft = ResultPoint(0.f, _topRight.value().y());
|
|
42
|
+
_bottomLeft = ResultPoint(0.f, _bottomRight.value().y());
|
|
43
|
+
}
|
|
44
|
+
else if (_topRight == nullptr) {
|
|
45
|
+
_topRight = ResultPoint(static_cast<float>(_imgWidth - 1), _topLeft.value().y());
|
|
46
|
+
_bottomRight = ResultPoint(static_cast<float>(_imgWidth - 1), _bottomLeft.value().y());
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
_minX = static_cast<int>(std::min(_topLeft.value().x(), _bottomLeft.value().x()));
|
|
50
|
+
_maxX = static_cast<int>(std::max(_topRight.value().x(), _bottomRight.value().x()));
|
|
51
|
+
_minY = static_cast<int>(std::min(_topLeft.value().y(), _topRight.value().y()));
|
|
52
|
+
_maxY = static_cast<int>(std::max(_bottomLeft.value().y(), _bottomRight.value().y()));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
bool
|
|
56
|
+
BoundingBox::Merge(const Nullable<BoundingBox>& leftBox, const Nullable<BoundingBox>& rightBox, Nullable<BoundingBox>& result)
|
|
57
|
+
{
|
|
58
|
+
if (leftBox == nullptr) {
|
|
59
|
+
result = rightBox;
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
if (rightBox == nullptr) {
|
|
63
|
+
result = leftBox;
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
BoundingBox box;
|
|
67
|
+
if (Create(leftBox.value()._imgWidth, leftBox.value()._imgHeight, leftBox.value()._topLeft, leftBox.value()._bottomLeft, rightBox.value()._topRight, rightBox.value()._bottomRight, box)) {
|
|
68
|
+
result = box;
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
bool
|
|
75
|
+
BoundingBox::AddMissingRows(const BoundingBox& box, int missingStartRows, int missingEndRows, bool isLeft, BoundingBox& result)
|
|
76
|
+
{
|
|
77
|
+
auto newTopLeft = box._topLeft;
|
|
78
|
+
auto newBottomLeft = box._bottomLeft;
|
|
79
|
+
auto newTopRight = box._topRight;
|
|
80
|
+
auto newBottomRight = box._bottomRight;
|
|
81
|
+
|
|
82
|
+
if (missingStartRows > 0) {
|
|
83
|
+
auto top = isLeft ? box._topLeft : box._topRight;
|
|
84
|
+
int newMinY = static_cast<int>(top.value().y()) - missingStartRows;
|
|
85
|
+
if (newMinY < 0) {
|
|
86
|
+
newMinY = 0;
|
|
87
|
+
}
|
|
88
|
+
ResultPoint newTop(top.value().x(), static_cast<float>(newMinY));
|
|
89
|
+
if (isLeft) {
|
|
90
|
+
newTopLeft = newTop;
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
newTopRight = newTop;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (missingEndRows > 0) {
|
|
98
|
+
auto bottom = isLeft ? box._bottomLeft : box._bottomRight;
|
|
99
|
+
int newMaxY = (int)bottom.value().y() + missingEndRows;
|
|
100
|
+
if (newMaxY >= box._imgHeight) {
|
|
101
|
+
newMaxY = box._imgHeight - 1;
|
|
102
|
+
}
|
|
103
|
+
ResultPoint newBottom(bottom.value().x(), static_cast<float>(newMaxY));
|
|
104
|
+
if (isLeft) {
|
|
105
|
+
newBottomLeft = newBottom;
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
newBottomRight = newBottom;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return Create(box._imgWidth, box._imgHeight, newTopLeft, newBottomLeft, newTopRight, newBottomRight, result);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
} // Pdf417
|
|
116
|
+
} // ZXing
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2016 Nu-book Inc.
|
|
3
|
+
* Copyright 2016 ZXing authors
|
|
4
|
+
*/
|
|
5
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
|
|
7
|
+
#pragma once
|
|
8
|
+
|
|
9
|
+
#include "ZXNullable.h"
|
|
10
|
+
#include "ResultPoint.h"
|
|
11
|
+
|
|
12
|
+
namespace ZXing {
|
|
13
|
+
namespace Pdf417 {
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @author Guenther Grau
|
|
17
|
+
*/
|
|
18
|
+
class BoundingBox
|
|
19
|
+
{
|
|
20
|
+
int _imgWidth;
|
|
21
|
+
int _imgHeight;
|
|
22
|
+
Nullable<ResultPoint> _topLeft;
|
|
23
|
+
Nullable<ResultPoint> _bottomLeft;
|
|
24
|
+
Nullable<ResultPoint> _topRight;
|
|
25
|
+
Nullable<ResultPoint> _bottomRight;
|
|
26
|
+
int _minX;
|
|
27
|
+
int _maxX;
|
|
28
|
+
int _minY;
|
|
29
|
+
int _maxY;
|
|
30
|
+
|
|
31
|
+
public:
|
|
32
|
+
BoundingBox();
|
|
33
|
+
|
|
34
|
+
int minX() const {
|
|
35
|
+
return _minX;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
int maxX() const {
|
|
39
|
+
return _maxX;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
int minY() const {
|
|
43
|
+
return _minY;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
int maxY() const {
|
|
47
|
+
return _maxY;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
Nullable<ResultPoint> topLeft() const {
|
|
51
|
+
return _topLeft;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
Nullable<ResultPoint> topRight() const {
|
|
55
|
+
return _topRight;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
Nullable<ResultPoint> bottomLeft() const {
|
|
59
|
+
return _bottomLeft;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
Nullable<ResultPoint> bottomRight() const {
|
|
63
|
+
return _bottomRight;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
static bool Create(int imgWidth, int imgHeight, const Nullable<ResultPoint>& topLeft, const Nullable<ResultPoint>& bottomLeft, const Nullable<ResultPoint>& topRight, const Nullable<ResultPoint>& bottomRight, BoundingBox& result);
|
|
67
|
+
static bool Merge(const Nullable<BoundingBox>& leftBox, const Nullable<BoundingBox>& rightBox, Nullable<BoundingBox>& result);
|
|
68
|
+
static bool AddMissingRows(const BoundingBox&box, int missingStartRows, int missingEndRows, bool isLeft, BoundingBox& result);
|
|
69
|
+
|
|
70
|
+
private:
|
|
71
|
+
void calculateMinMaxValues();
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
} // Pdf417
|
|
75
|
+
} // ZXing
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2016 Nu-book Inc.
|
|
3
|
+
* Copyright 2016 ZXing authors
|
|
4
|
+
*/
|
|
5
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
|
|
7
|
+
#pragma once
|
|
8
|
+
|
|
9
|
+
namespace ZXing {
|
|
10
|
+
namespace Pdf417 {
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @author Guenther Grau
|
|
14
|
+
*/
|
|
15
|
+
class Codeword
|
|
16
|
+
{
|
|
17
|
+
static const int BARCODE_ROW_UNKNOWN = -1;
|
|
18
|
+
|
|
19
|
+
int _startX = 0;
|
|
20
|
+
int _endX = 0;
|
|
21
|
+
int _bucket = 0;
|
|
22
|
+
int _value = 0;
|
|
23
|
+
int _rowNumber = BARCODE_ROW_UNKNOWN;
|
|
24
|
+
|
|
25
|
+
public:
|
|
26
|
+
Codeword() = default;
|
|
27
|
+
Codeword(int startX, int endX, int bucket, int value) : _startX(startX), _endX(endX), _bucket(bucket), _value(value) {}
|
|
28
|
+
|
|
29
|
+
bool hasValidRowNumber() const {
|
|
30
|
+
return isValidRowNumber(_rowNumber);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
bool isValidRowNumber(int rowNumber) const {
|
|
34
|
+
return rowNumber != BARCODE_ROW_UNKNOWN && _bucket == (rowNumber % 3) * 3;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
void setRowNumberAsRowIndicatorColumn() {
|
|
38
|
+
_rowNumber = (_value / 30) * 3 + _bucket / 3;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
int width() const {
|
|
42
|
+
return _endX - _startX;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
int startX() const {
|
|
46
|
+
return _startX;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
int endX() const {
|
|
50
|
+
return _endX;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
int bucket() const {
|
|
54
|
+
return _bucket;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
int value() const {
|
|
58
|
+
return _value;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
int rowNumber() const {
|
|
62
|
+
return _rowNumber;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
void setRowNumber(int rowNumber) {
|
|
66
|
+
_rowNumber = rowNumber;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
} // Pdf417
|
|
71
|
+
} // ZXing
|