zxing_cpp 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +13 -0
- data/.gitmodules +3 -0
- data/CHANGELOG.rdoc +6 -0
- data/Gemfile +3 -0
- data/Manifest.txt +331 -0
- data/README.rdoc +138 -0
- data/Rakefile +28 -0
- data/bin/zxd +87 -0
- data/bin/zxe +53 -0
- data/ext/zxing/extconf.rb +27 -0
- data/ext/zxing/zxing-cpp/.gitignore +4 -0
- data/ext/zxing/zxing-cpp/AUTHORS +115 -0
- data/ext/zxing/zxing-cpp/CMakeLists.txt +84 -0
- data/ext/zxing/zxing-cpp/COPYING +201 -0
- data/ext/zxing/zxing-cpp/NOTICE +65 -0
- data/ext/zxing/zxing-cpp/README.md +50 -0
- data/ext/zxing/zxing-cpp/cli/src/ImageReaderSource.cpp +112 -0
- data/ext/zxing/zxing-cpp/cli/src/ImageReaderSource.h +40 -0
- data/ext/zxing/zxing-cpp/cli/src/jpgd.cpp +3174 -0
- data/ext/zxing/zxing-cpp/cli/src/jpgd.h +319 -0
- data/ext/zxing/zxing-cpp/cli/src/lodepng.cpp +6261 -0
- data/ext/zxing/zxing-cpp/cli/src/lodepng.h +1695 -0
- data/ext/zxing/zxing-cpp/cli/src/main.cpp +297 -0
- data/ext/zxing/zxing-cpp/cmake/FindCPPUNIT.cmake +54 -0
- data/ext/zxing/zxing-cpp/cmake/FindIconv.cmake +57 -0
- data/ext/zxing/zxing-cpp/core/src/bigint/.gitignore +6 -0
- data/ext/zxing/zxing-cpp/core/src/bigint/BigInteger.cc +405 -0
- data/ext/zxing/zxing-cpp/core/src/bigint/BigInteger.hh +215 -0
- data/ext/zxing/zxing-cpp/core/src/bigint/BigIntegerAlgorithms.cc +70 -0
- data/ext/zxing/zxing-cpp/core/src/bigint/BigIntegerAlgorithms.hh +25 -0
- data/ext/zxing/zxing-cpp/core/src/bigint/BigIntegerLibrary.hh +8 -0
- data/ext/zxing/zxing-cpp/core/src/bigint/BigIntegerUtils.cc +50 -0
- data/ext/zxing/zxing-cpp/core/src/bigint/BigIntegerUtils.hh +72 -0
- data/ext/zxing/zxing-cpp/core/src/bigint/BigUnsigned.cc +697 -0
- data/ext/zxing/zxing-cpp/core/src/bigint/BigUnsigned.hh +418 -0
- data/ext/zxing/zxing-cpp/core/src/bigint/BigUnsignedInABase.cc +125 -0
- data/ext/zxing/zxing-cpp/core/src/bigint/BigUnsignedInABase.hh +122 -0
- data/ext/zxing/zxing-cpp/core/src/bigint/ChangeLog +146 -0
- data/ext/zxing/zxing-cpp/core/src/bigint/Makefile +73 -0
- data/ext/zxing/zxing-cpp/core/src/bigint/NumberlikeArray.hh +177 -0
- data/ext/zxing/zxing-cpp/core/src/bigint/README +71 -0
- data/ext/zxing/zxing-cpp/core/src/win32/zxing/iconv.h +14 -0
- data/ext/zxing/zxing-cpp/core/src/win32/zxing/stdint.h +247 -0
- data/ext/zxing/zxing-cpp/core/src/win32/zxing/win_iconv.c +2035 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/BarcodeFormat.cpp +40 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/BarcodeFormat.h +60 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/Binarizer.cpp +45 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/Binarizer.h +50 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/BinaryBitmap.cpp +70 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/BinaryBitmap.h +56 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/ChecksumException.cpp +28 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/ChecksumException.h +34 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/DecodeHints.cpp +142 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/DecodeHints.h +85 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/Exception.cpp +43 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/Exception.h +51 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/FormatException.cpp +41 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/FormatException.h +37 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/IllegalStateException.h +35 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/InvertedLuminanceSource.cpp +68 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/InvertedLuminanceSource.h +48 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/LuminanceSource.cpp +86 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/LuminanceSource.h +59 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/MultiFormatReader.cpp +124 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/MultiFormatReader.h +48 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/NotFoundException.h +35 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/Reader.cpp +31 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/Reader.h +40 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/ReaderException.h +37 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/Result.cpp +61 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/Result.h +55 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/ResultIO.cpp +34 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/ResultPoint.cpp +108 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/ResultPoint.h +55 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/ResultPointCallback.cpp +26 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/ResultPointCallback.h +39 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/ZXing.h +133 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/aztec/AztecDetectorResult.cpp +54 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/aztec/AztecDetectorResult.h +48 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/aztec/AztecReader.cpp +68 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/aztec/AztecReader.h +49 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/aztec/decoder/Decoder.cpp +489 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/aztec/decoder/Decoder.h +69 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/aztec/detector/Detector.cpp +548 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/aztec/detector/Detector.h +92 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/Array.h +170 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/BitArray.cpp +155 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/BitArray.h +81 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/BitArrayIO.cpp +31 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/BitMatrix.cpp +143 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/BitMatrix.h +91 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/BitSource.cpp +76 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/BitSource.h +74 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/CharacterSetECI.cpp +104 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/CharacterSetECI.h +53 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/Counted.h +140 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/DecoderResult.cpp +46 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/DecoderResult.h +51 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/DetectorResult.cpp +39 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/DetectorResult.h +43 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/GlobalHistogramBinarizer.cpp +212 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/GlobalHistogramBinarizer.h +48 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/GreyscaleLuminanceSource.cpp +80 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/GreyscaleLuminanceSource.h +53 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/GreyscaleRotatedLuminanceSource.cpp +81 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/GreyscaleRotatedLuminanceSource.h +46 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/GridSampler.cpp +122 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/GridSampler.h +45 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/HybridBinarizer.cpp +226 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/HybridBinarizer.h +67 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/IllegalArgumentException.cpp +27 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/IllegalArgumentException.h +36 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/PerspectiveTransform.cpp +107 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/PerspectiveTransform.h +49 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/Point.h +47 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/Str.cpp +61 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/Str.h +51 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/StringUtils.cpp +198 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/StringUtils.h +52 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/detector/JavaMath.h +43 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/detector/MathUtils.h +57 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/detector/MonochromeRectangleDetector.cpp +174 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/detector/MonochromeRectangleDetector.h +62 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/detector/WhiteRectangleDetector.cpp +330 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/detector/WhiteRectangleDetector.h +59 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/reedsolomon/GenericGF.cpp +150 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/reedsolomon/GenericGF.h +73 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/reedsolomon/GenericGFPoly.cpp +218 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/reedsolomon/GenericGFPoly.h +56 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/reedsolomon/ReedSolomonDecoder.cpp +174 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/reedsolomon/ReedSolomonDecoder.h +49 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/reedsolomon/ReedSolomonException.cpp +30 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/common/reedsolomon/ReedSolomonException.h +33 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/datamatrix/DataMatrixReader.cpp +54 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/datamatrix/DataMatrixReader.h +45 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/datamatrix/Version.cpp +199 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/datamatrix/Version.h +87 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/datamatrix/decoder/BitMatrixParser.cpp +361 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/datamatrix/decoder/BitMatrixParser.h +59 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/datamatrix/decoder/DataBlock.cpp +113 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/datamatrix/decoder/DataBlock.h +49 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/datamatrix/decoder/DecodedBitStreamParser.cpp +416 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/datamatrix/decoder/DecodedBitStreamParser.h +104 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/datamatrix/decoder/Decoder.cpp +93 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/datamatrix/decoder/Decoder.h +49 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/datamatrix/detector/CornerPoint.cpp +46 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/datamatrix/detector/CornerPoint.h +43 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/datamatrix/detector/Detector.cpp +446 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/datamatrix/detector/Detector.h +94 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/datamatrix/detector/DetectorException.cpp +23 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/datamatrix/detector/DetectorException.h +23 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/multi/ByQuadrantReader.cpp +75 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/multi/ByQuadrantReader.h +42 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/multi/GenericMultipleBarcodeReader.cpp +137 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/multi/GenericMultipleBarcodeReader.h +51 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/multi/MultipleBarcodeReader.cpp +29 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/multi/MultipleBarcodeReader.h +41 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/multi/qrcode/QRCodeMultiReader.cpp +58 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/multi/qrcode/QRCodeMultiReader.h +36 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/multi/qrcode/detector/MultiDetector.cpp +47 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/multi/qrcode/detector/MultiDetector.h +37 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/multi/qrcode/detector/MultiFinderPatternFinder.cpp +236 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/multi/qrcode/detector/MultiFinderPatternFinder.h +47 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/oned/CodaBarReader.cpp +340 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/oned/CodaBarReader.h +57 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/oned/Code128Reader.cpp +496 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/oned/Code128Reader.h +48 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/oned/Code39Reader.cpp +328 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/oned/Code39Reader.h +63 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/oned/Code93Reader.cpp +293 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/oned/Code93Reader.h +58 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/oned/EAN13Reader.cpp +85 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/oned/EAN13Reader.h +49 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/oned/EAN8Reader.cpp +65 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/oned/EAN8Reader.h +47 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/oned/ITFReader.cpp +337 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/oned/ITFReader.h +54 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/oned/MultiFormatOneDReader.cpp +96 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/oned/MultiFormatOneDReader.h +38 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/oned/MultiFormatUPCEANReader.cpp +110 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/oned/MultiFormatUPCEANReader.h +41 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/oned/OneDReader.cpp +227 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/oned/OneDReader.h +81 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/oned/OneDResultPoint.cpp +28 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/oned/OneDResultPoint.h +35 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/oned/UPCAReader.cpp +71 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/oned/UPCAReader.h +50 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/oned/UPCEANReader.cpp +309 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/oned/UPCEANReader.h +88 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/oned/UPCEReader.cpp +146 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/oned/UPCEReader.h +47 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/pdf417/PDF417Reader.cpp +170 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/pdf417/PDF417Reader.h +49 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/pdf417/decoder/BitMatrixParser.cpp +997 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/pdf417/decoder/BitMatrixParser.h +84 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/pdf417/decoder/DecodedBitStreamParser.cpp +563 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/pdf417/decoder/DecodedBitStreamParser.h +84 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/pdf417/decoder/Decoder.cpp +118 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/pdf417/decoder/Decoder.h +62 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/pdf417/decoder/ec/ErrorCorrection.cpp +214 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/pdf417/decoder/ec/ErrorCorrection.h +71 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/pdf417/decoder/ec/ModulusGF.cpp +120 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/pdf417/decoder/ec/ModulusGF.h +72 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/pdf417/decoder/ec/ModulusPoly.cpp +284 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/pdf417/decoder/ec/ModulusPoly.h +68 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/pdf417/detector/Detector.cpp +664 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/pdf417/detector/Detector.h +106 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/pdf417/detector/LinesSampler.cpp +714 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/pdf417/detector/LinesSampler.h +122 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/qrcode/ErrorCorrectionLevel.cpp +65 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/qrcode/ErrorCorrectionLevel.h +52 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/qrcode/FormatInformation.cpp +117 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/qrcode/FormatInformation.h +54 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/qrcode/QRCodeReader.cpp +52 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/qrcode/QRCodeReader.h +48 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/qrcode/Version.cpp +560 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/qrcode/Version.h +85 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/qrcode/decoder/BitMatrixParser.cpp +183 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/qrcode/decoder/BitMatrixParser.h +56 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/qrcode/decoder/DataBlock.cpp +118 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/qrcode/decoder/DataBlock.h +50 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/qrcode/decoder/DataMask.cpp +159 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/qrcode/decoder/DataMask.h +50 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/qrcode/decoder/DecodedBitStreamParser.cpp +425 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/qrcode/decoder/DecodedBitStreamParser.h +72 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/qrcode/decoder/Decoder.cpp +107 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/qrcode/decoder/Decoder.h +46 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/qrcode/decoder/Mode.cpp +90 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/qrcode/decoder/Mode.h +57 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/qrcode/detector/AlignmentPattern.cpp +47 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/qrcode/detector/AlignmentPattern.h +45 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/qrcode/detector/AlignmentPatternFinder.cpp +208 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/qrcode/detector/AlignmentPatternFinder.h +68 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/qrcode/detector/Detector.cpp +314 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/qrcode/detector/Detector.h +69 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/qrcode/detector/FinderPattern.cpp +69 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/qrcode/detector/FinderPattern.h +48 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/qrcode/detector/FinderPatternFinder.cpp +559 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/qrcode/detector/FinderPatternFinder.h +76 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/qrcode/detector/FinderPatternInfo.cpp +41 -0
- data/ext/zxing/zxing-cpp/core/src/zxing/qrcode/detector/FinderPatternInfo.h +47 -0
- data/ext/zxing/zxing-cpp/core/tests/src/TestRunner.cpp +30 -0
- data/ext/zxing/zxing-cpp/core/tests/src/common/BitArrayTest.cpp +216 -0
- data/ext/zxing/zxing-cpp/core/tests/src/common/BitArrayTest.h +61 -0
- data/ext/zxing/zxing-cpp/core/tests/src/common/BitMatrixTest.cpp +106 -0
- data/ext/zxing/zxing-cpp/core/tests/src/common/BitMatrixTest.h +55 -0
- data/ext/zxing/zxing-cpp/core/tests/src/common/BitSourceTest.cpp +49 -0
- data/ext/zxing/zxing-cpp/core/tests/src/common/BitSourceTest.h +42 -0
- data/ext/zxing/zxing-cpp/core/tests/src/common/CountedTest.cpp +58 -0
- data/ext/zxing/zxing-cpp/core/tests/src/common/CountedTest.h +46 -0
- data/ext/zxing/zxing-cpp/core/tests/src/common/PerspectiveTransformTest.cpp +69 -0
- data/ext/zxing/zxing-cpp/core/tests/src/common/PerspectiveTransformTest.h +47 -0
- data/ext/zxing/zxing-cpp/core/tests/src/common/reedsolomon/ReedSolomonTest.cpp +129 -0
- data/ext/zxing/zxing-cpp/core/tests/src/common/reedsolomon/ReedSolomonTest.h +62 -0
- data/ext/zxing/zxing-cpp/core/tests/src/qrcode/ErrorCorrectionLevelTest.cpp +47 -0
- data/ext/zxing/zxing-cpp/core/tests/src/qrcode/ErrorCorrectionLevelTest.h +45 -0
- data/ext/zxing/zxing-cpp/core/tests/src/qrcode/FormatInformationTest.cpp +88 -0
- data/ext/zxing/zxing-cpp/core/tests/src/qrcode/FormatInformationTest.h +47 -0
- data/ext/zxing/zxing-cpp/core/tests/src/qrcode/VersionTest.cpp +88 -0
- data/ext/zxing/zxing-cpp/core/tests/src/qrcode/VersionTest.h +49 -0
- data/ext/zxing/zxing-cpp/core/tests/src/qrcode/decoder/DataMaskTest.cpp +132 -0
- data/ext/zxing/zxing-cpp/core/tests/src/qrcode/decoder/DataMaskTest.h +91 -0
- data/ext/zxing/zxing-cpp/core/tests/src/qrcode/decoder/ModeTest.cpp +52 -0
- data/ext/zxing/zxing-cpp/core/tests/src/qrcode/decoder/ModeTest.h +47 -0
- data/ext/zxing/zxing.cc +224 -0
- data/lib/zxing.rb +50 -0
- data/lib/zxing/.gitignore +2 -0
- data/lib/zxing/aztec.rb +5 -0
- data/lib/zxing/aztec/aztec_reader.rb +14 -0
- data/lib/zxing/bad_image_exception.rb +4 -0
- data/lib/zxing/binarizer.rb +8 -0
- data/lib/zxing/binary_bitmap.rb +15 -0
- data/lib/zxing/checksum_exception.rb +4 -0
- data/lib/zxing/common.rb +7 -0
- data/lib/zxing/common/bit_matrix.rb +9 -0
- data/lib/zxing/common/hybrid_binarizer.rb +17 -0
- data/lib/zxing/common/illegal_argument_exception.rb +4 -0
- data/lib/zxing/datamatrix.rb +5 -0
- data/lib/zxing/datamatrix/data_matrix_reader.rb +14 -0
- data/lib/zxing/decodable.rb +11 -0
- data/lib/zxing/exception.rb +4 -0
- data/lib/zxing/ffi.rb +20 -0
- data/lib/zxing/ffi/aztec.rb +6 -0
- data/lib/zxing/ffi/aztec/aztec_reader.rb +9 -0
- data/lib/zxing/ffi/binarizer.rb +25 -0
- data/lib/zxing/ffi/binary_bitmap.rb +15 -0
- data/lib/zxing/ffi/common.rb +8 -0
- data/lib/zxing/ffi/common/bit_matrix.rb +12 -0
- data/lib/zxing/ffi/common/greyscale_luminance_source.rb +30 -0
- data/lib/zxing/ffi/common/hybrid_binarizer.rb +10 -0
- data/lib/zxing/ffi/datamatrix.rb +6 -0
- data/lib/zxing/ffi/datamatrix/data_matrix_reader.rb +9 -0
- data/lib/zxing/ffi/library.rb +102 -0
- data/lib/zxing/ffi/luminance_source.rb +18 -0
- data/lib/zxing/ffi/multi_format_reader.rb +9 -0
- data/lib/zxing/ffi/oned.rb +6 -0
- data/lib/zxing/ffi/oned/code_39_reader.rb +10 -0
- data/lib/zxing/ffi/qrcode.rb +8 -0
- data/lib/zxing/ffi/qrcode/decoder.rb +10 -0
- data/lib/zxing/ffi/qrcode/detector.rb +10 -0
- data/lib/zxing/ffi/reader.rb +58 -0
- data/lib/zxing/ffi/result.rb +23 -0
- data/lib/zxing/format_exception.rb +4 -0
- data/lib/zxing/illegal_argument_exception.rb +4 -0
- data/lib/zxing/image.rb +15 -0
- data/lib/zxing/luminance_source.rb +18 -0
- data/lib/zxing/multi_format_reader.rb +11 -0
- data/lib/zxing/not_found_exception.rb +4 -0
- data/lib/zxing/oned.rb +5 -0
- data/lib/zxing/oned/code_39_reader.rb +15 -0
- data/lib/zxing/qrcode.rb +8 -0
- data/lib/zxing/qrcode/decoder.rb +14 -0
- data/lib/zxing/qrcode/detector.rb +14 -0
- data/lib/zxing/qrcode/encoder.rb +8 -0
- data/lib/zxing/qrcode/encoder/byte_matrix.rb +18 -0
- data/lib/zxing/qrcode/encoder/encoder.rb +9 -0
- data/lib/zxing/qrcode/encoder/qrcode.rb +18 -0
- data/lib/zxing/reader.rb +8 -0
- data/lib/zxing/reader_exception.rb +4 -0
- data/lib/zxing/reed_solomon_exception.rb +2 -0
- data/lib/zxing/result.rb +18 -0
- data/lib/zxing/rmagick.rb +5 -0
- data/lib/zxing/rmagick/image.rb +104 -0
- data/lib/zxing/version.rb +33 -0
- data/test/qrcode.png +0 -0
- data/test/test_helper.rb +5 -0
- data/test/test_zxing.rb +58 -0
- data/test/vendor.rb +360 -0
- data/test/zxing/test_decodable.rb +38 -0
- data/zxing_cpp.gemspec +48 -0
- metadata +473 -0
@@ -0,0 +1,40 @@
|
|
1
|
+
// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
|
2
|
+
/*
|
3
|
+
* Created by Christian Brunschen on 13/05/2008.
|
4
|
+
* Copyright 2008 ZXing authors All rights reserved.
|
5
|
+
*
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
* you may not use this file except in compliance with the License.
|
8
|
+
* You may obtain a copy of the License at
|
9
|
+
*
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
*
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
* See the License for the specific language governing permissions and
|
16
|
+
* limitations under the License.
|
17
|
+
*/
|
18
|
+
|
19
|
+
#include <zxing/BarcodeFormat.h>
|
20
|
+
|
21
|
+
const char* zxing::BarcodeFormat::barcodeFormatNames[] = {
|
22
|
+
0,
|
23
|
+
"AZTEC",
|
24
|
+
"CODABAR",
|
25
|
+
"CODE_39",
|
26
|
+
"CODE_93",
|
27
|
+
"CODE_128",
|
28
|
+
"DATA_MATRIX",
|
29
|
+
"EAN_8",
|
30
|
+
"EAN_13",
|
31
|
+
"ITF",
|
32
|
+
"MAXICODE",
|
33
|
+
"PDF_417",
|
34
|
+
"QR_CODE",
|
35
|
+
"RSS_14",
|
36
|
+
"RSS_EXPANDED",
|
37
|
+
"UPC_A",
|
38
|
+
"UPC_E",
|
39
|
+
"UPC_EAN_EXTENSION"
|
40
|
+
};
|
@@ -0,0 +1,60 @@
|
|
1
|
+
// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
|
2
|
+
#ifndef __BARCODE_FORMAT_H__
|
3
|
+
#define __BARCODE_FORMAT_H__
|
4
|
+
|
5
|
+
/*
|
6
|
+
* BarcodeFormat.h
|
7
|
+
* zxing
|
8
|
+
*
|
9
|
+
* Copyright 2010 ZXing authors All rights reserved.
|
10
|
+
*
|
11
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
12
|
+
* you may not use this file except in compliance with the License.
|
13
|
+
* You may obtain a copy of the License at
|
14
|
+
*
|
15
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
16
|
+
*
|
17
|
+
* Unless required by applicable law or agreed to in writing, software
|
18
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
19
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
20
|
+
* See the License for the specific language governing permissions and
|
21
|
+
* limitations under the License.
|
22
|
+
*/
|
23
|
+
|
24
|
+
namespace zxing {
|
25
|
+
|
26
|
+
class BarcodeFormat {
|
27
|
+
public:
|
28
|
+
// if you update the enum, update BarcodeFormat.cpp
|
29
|
+
|
30
|
+
enum Value {
|
31
|
+
NONE,
|
32
|
+
AZTEC,
|
33
|
+
CODABAR,
|
34
|
+
CODE_39,
|
35
|
+
CODE_93,
|
36
|
+
CODE_128,
|
37
|
+
DATA_MATRIX,
|
38
|
+
EAN_8,
|
39
|
+
EAN_13,
|
40
|
+
ITF,
|
41
|
+
MAXICODE,
|
42
|
+
PDF_417,
|
43
|
+
QR_CODE,
|
44
|
+
RSS_14,
|
45
|
+
RSS_EXPANDED,
|
46
|
+
UPC_A,
|
47
|
+
UPC_E,
|
48
|
+
UPC_EAN_EXTENSION
|
49
|
+
};
|
50
|
+
|
51
|
+
BarcodeFormat(Value v) : value(v) {}
|
52
|
+
const Value value;
|
53
|
+
operator Value () const {return value;}
|
54
|
+
|
55
|
+
static char const* barcodeFormatNames[];
|
56
|
+
};
|
57
|
+
|
58
|
+
}
|
59
|
+
|
60
|
+
#endif // __BARCODE_FORMAT_H__
|
@@ -0,0 +1,45 @@
|
|
1
|
+
// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
|
2
|
+
/*
|
3
|
+
* Binarizer.cpp
|
4
|
+
* zxing
|
5
|
+
*
|
6
|
+
* Created by Ralf Kistner on 16/10/2009.
|
7
|
+
* Copyright 2008 ZXing authors All rights reserved.
|
8
|
+
* Modified by Lukasz Warchol on 02/02/2010.
|
9
|
+
*
|
10
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
11
|
+
* you may not use this file except in compliance with the License.
|
12
|
+
* You may obtain a copy of the License at
|
13
|
+
*
|
14
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
15
|
+
*
|
16
|
+
* Unless required by applicable law or agreed to in writing, software
|
17
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
18
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
19
|
+
* See the License for the specific language governing permissions and
|
20
|
+
* limitations under the License.
|
21
|
+
*/
|
22
|
+
|
23
|
+
#include <zxing/Binarizer.h>
|
24
|
+
|
25
|
+
namespace zxing {
|
26
|
+
|
27
|
+
Binarizer::Binarizer(Ref<LuminanceSource> source) : source_(source) {
|
28
|
+
}
|
29
|
+
|
30
|
+
Binarizer::~Binarizer() {
|
31
|
+
}
|
32
|
+
|
33
|
+
Ref<LuminanceSource> Binarizer::getLuminanceSource() const {
|
34
|
+
return source_;
|
35
|
+
}
|
36
|
+
|
37
|
+
int Binarizer::getWidth() const {
|
38
|
+
return source_->getWidth();
|
39
|
+
}
|
40
|
+
|
41
|
+
int Binarizer::getHeight() const {
|
42
|
+
return source_->getHeight();
|
43
|
+
}
|
44
|
+
|
45
|
+
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
#ifndef BINARIZER_H_
|
2
|
+
#define BINARIZER_H_
|
3
|
+
|
4
|
+
/*
|
5
|
+
* Binarizer.h
|
6
|
+
* zxing
|
7
|
+
*
|
8
|
+
* Copyright 2010 ZXing authors All rights reserved.
|
9
|
+
*
|
10
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
11
|
+
* you may not use this file except in compliance with the License.
|
12
|
+
* You may obtain a copy of the License at
|
13
|
+
*
|
14
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
15
|
+
*
|
16
|
+
* Unless required by applicable law or agreed to in writing, software
|
17
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
18
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
19
|
+
* See the License for the specific language governing permissions and
|
20
|
+
* limitations under the License.
|
21
|
+
*/
|
22
|
+
|
23
|
+
#include <zxing/LuminanceSource.h>
|
24
|
+
#include <zxing/common/BitArray.h>
|
25
|
+
#include <zxing/common/BitMatrix.h>
|
26
|
+
#include <zxing/common/Counted.h>
|
27
|
+
|
28
|
+
namespace zxing {
|
29
|
+
|
30
|
+
class Binarizer : public Counted {
|
31
|
+
private:
|
32
|
+
Ref<LuminanceSource> source_;
|
33
|
+
|
34
|
+
public:
|
35
|
+
Binarizer(Ref<LuminanceSource> source);
|
36
|
+
virtual ~Binarizer();
|
37
|
+
|
38
|
+
virtual Ref<BitArray> getBlackRow(int y, Ref<BitArray> row) = 0;
|
39
|
+
virtual Ref<BitMatrix> getBlackMatrix() = 0;
|
40
|
+
|
41
|
+
Ref<LuminanceSource> getLuminanceSource() const ;
|
42
|
+
virtual Ref<Binarizer> createBinarizer(Ref<LuminanceSource> source) = 0;
|
43
|
+
|
44
|
+
int getWidth() const;
|
45
|
+
int getHeight() const;
|
46
|
+
|
47
|
+
};
|
48
|
+
|
49
|
+
}
|
50
|
+
#endif /* BINARIZER_H_ */
|
@@ -0,0 +1,70 @@
|
|
1
|
+
// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
|
2
|
+
/*
|
3
|
+
* Copyright 2010 ZXing authors All rights reserved.
|
4
|
+
*
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
* you may not use this file except in compliance with the License.
|
7
|
+
* You may obtain a copy of the License at
|
8
|
+
*
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
*
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
* See the License for the specific language governing permissions and
|
15
|
+
* limitations under the License.
|
16
|
+
*/
|
17
|
+
|
18
|
+
#include <zxing/BinaryBitmap.h>
|
19
|
+
|
20
|
+
using zxing::Ref;
|
21
|
+
using zxing::BitArray;
|
22
|
+
using zxing::BitMatrix;
|
23
|
+
using zxing::LuminanceSource;
|
24
|
+
using zxing::BinaryBitmap;
|
25
|
+
|
26
|
+
// VC++
|
27
|
+
using zxing::Binarizer;
|
28
|
+
|
29
|
+
BinaryBitmap::BinaryBitmap(Ref<Binarizer> binarizer) : binarizer_(binarizer) {
|
30
|
+
}
|
31
|
+
|
32
|
+
BinaryBitmap::~BinaryBitmap() {
|
33
|
+
}
|
34
|
+
|
35
|
+
Ref<BitArray> BinaryBitmap::getBlackRow(int y, Ref<BitArray> row) {
|
36
|
+
return binarizer_->getBlackRow(y, row);
|
37
|
+
}
|
38
|
+
|
39
|
+
Ref<BitMatrix> BinaryBitmap::getBlackMatrix() {
|
40
|
+
return binarizer_->getBlackMatrix();
|
41
|
+
}
|
42
|
+
|
43
|
+
int BinaryBitmap::getWidth() const {
|
44
|
+
return getLuminanceSource()->getWidth();
|
45
|
+
}
|
46
|
+
|
47
|
+
int BinaryBitmap::getHeight() const {
|
48
|
+
return getLuminanceSource()->getHeight();
|
49
|
+
}
|
50
|
+
|
51
|
+
Ref<LuminanceSource> BinaryBitmap::getLuminanceSource() const {
|
52
|
+
return binarizer_->getLuminanceSource();
|
53
|
+
}
|
54
|
+
|
55
|
+
|
56
|
+
bool BinaryBitmap::isCropSupported() const {
|
57
|
+
return getLuminanceSource()->isCropSupported();
|
58
|
+
}
|
59
|
+
|
60
|
+
Ref<BinaryBitmap> BinaryBitmap::crop(int left, int top, int width, int height) {
|
61
|
+
return Ref<BinaryBitmap> (new BinaryBitmap(binarizer_->createBinarizer(getLuminanceSource()->crop(left, top, width, height))));
|
62
|
+
}
|
63
|
+
|
64
|
+
bool BinaryBitmap::isRotateSupported() const {
|
65
|
+
return getLuminanceSource()->isRotateSupported();
|
66
|
+
}
|
67
|
+
|
68
|
+
Ref<BinaryBitmap> BinaryBitmap::rotateCounterClockwise() {
|
69
|
+
return Ref<BinaryBitmap> (new BinaryBitmap(binarizer_->createBinarizer(getLuminanceSource()->rotateCounterClockwise())));
|
70
|
+
}
|
@@ -0,0 +1,56 @@
|
|
1
|
+
#ifndef __BINARYBITMAP_H__
|
2
|
+
#define __BINARYBITMAP_H__
|
3
|
+
|
4
|
+
/*
|
5
|
+
* BinaryBitmap.h
|
6
|
+
* zxing
|
7
|
+
*
|
8
|
+
* Copyright 2010 ZXing authors All rights reserved.
|
9
|
+
*
|
10
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
11
|
+
* you may not use this file except in compliance with the License.
|
12
|
+
* You may obtain a copy of the License at
|
13
|
+
*
|
14
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
15
|
+
*
|
16
|
+
* Unless required by applicable law or agreed to in writing, software
|
17
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
18
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
19
|
+
* See the License for the specific language governing permissions and
|
20
|
+
* limitations under the License.
|
21
|
+
*/
|
22
|
+
|
23
|
+
#include <zxing/common/Counted.h>
|
24
|
+
#include <zxing/common/BitMatrix.h>
|
25
|
+
#include <zxing/common/BitArray.h>
|
26
|
+
#include <zxing/Binarizer.h>
|
27
|
+
|
28
|
+
namespace zxing {
|
29
|
+
|
30
|
+
class BinaryBitmap : public Counted {
|
31
|
+
private:
|
32
|
+
Ref<Binarizer> binarizer_;
|
33
|
+
|
34
|
+
public:
|
35
|
+
BinaryBitmap(Ref<Binarizer> binarizer);
|
36
|
+
virtual ~BinaryBitmap();
|
37
|
+
|
38
|
+
Ref<BitArray> getBlackRow(int y, Ref<BitArray> row);
|
39
|
+
Ref<BitMatrix> getBlackMatrix();
|
40
|
+
|
41
|
+
Ref<LuminanceSource> getLuminanceSource() const;
|
42
|
+
|
43
|
+
int getWidth() const;
|
44
|
+
int getHeight() const;
|
45
|
+
|
46
|
+
bool isRotateSupported() const;
|
47
|
+
Ref<BinaryBitmap> rotateCounterClockwise();
|
48
|
+
|
49
|
+
bool isCropSupported() const;
|
50
|
+
Ref<BinaryBitmap> crop(int left, int top, int width, int height);
|
51
|
+
|
52
|
+
};
|
53
|
+
|
54
|
+
}
|
55
|
+
|
56
|
+
#endif /* BINARYBITMAP_H_ */
|
@@ -0,0 +1,28 @@
|
|
1
|
+
// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
|
2
|
+
/*
|
3
|
+
* ChecksumException.cpp
|
4
|
+
* zxing
|
5
|
+
*
|
6
|
+
* Created by Christian Brunschen on 13/05/2008.
|
7
|
+
* Copyright 2008 ZXing authors All rights reserved.
|
8
|
+
*
|
9
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
10
|
+
* you may not use this file except in compliance with the License.
|
11
|
+
* You may obtain a copy of the License at
|
12
|
+
*
|
13
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
14
|
+
*
|
15
|
+
* Unless required by applicable law or agreed to in writing, software
|
16
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
+
* See the License for the specific language governing permissions and
|
19
|
+
* limitations under the License.
|
20
|
+
*/
|
21
|
+
|
22
|
+
#include <zxing/ChecksumException.h>
|
23
|
+
|
24
|
+
using zxing::ChecksumException;
|
25
|
+
|
26
|
+
ChecksumException::ChecksumException() throw() {}
|
27
|
+
ChecksumException::ChecksumException(const char *msg) throw() : ReaderException(msg) {}
|
28
|
+
ChecksumException::~ChecksumException() throw() {}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
|
2
|
+
|
3
|
+
#ifndef __CHECKSUM_EXCEPTION_H__
|
4
|
+
#define __CHECKSUM_EXCEPTION_H__
|
5
|
+
|
6
|
+
/*
|
7
|
+
* Copyright 20011 ZXing authors
|
8
|
+
*
|
9
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
10
|
+
* you may not use this file except in compliance with the License.
|
11
|
+
* You may obtain a copy of the License at
|
12
|
+
*
|
13
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
14
|
+
*
|
15
|
+
* Unless required by applicable law or agreed to in writing, software
|
16
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
17
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
18
|
+
* See the License for the specific language governing permissions and
|
19
|
+
* limitations under the License.
|
20
|
+
*/
|
21
|
+
|
22
|
+
#include <zxing/ReaderException.h>
|
23
|
+
|
24
|
+
namespace zxing {
|
25
|
+
class ChecksumException : public ReaderException {
|
26
|
+
typedef ReaderException Base;
|
27
|
+
public:
|
28
|
+
ChecksumException() throw();
|
29
|
+
ChecksumException(const char *msg) throw();
|
30
|
+
~ChecksumException() throw();
|
31
|
+
};
|
32
|
+
}
|
33
|
+
|
34
|
+
#endif // __CHECKSUM_EXCEPTION_H__
|
@@ -0,0 +1,142 @@
|
|
1
|
+
// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
|
2
|
+
/*
|
3
|
+
* DecodeHintType.cpp
|
4
|
+
* zxing
|
5
|
+
*
|
6
|
+
* Copyright 2010 ZXing authors All rights reserved.
|
7
|
+
*
|
8
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
9
|
+
* you may not use this file except in compliance with the License.
|
10
|
+
* You may obtain a copy of the License at
|
11
|
+
*
|
12
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
13
|
+
*
|
14
|
+
* Unless required by applicable law or agreed to in writing, software
|
15
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
16
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
17
|
+
* See the License for the specific language governing permissions and
|
18
|
+
* limitations under the License.
|
19
|
+
*/
|
20
|
+
|
21
|
+
#include <zxing/DecodeHints.h>
|
22
|
+
#include <zxing/common/IllegalArgumentException.h>
|
23
|
+
|
24
|
+
using zxing::Ref;
|
25
|
+
using zxing::ResultPointCallback;
|
26
|
+
using zxing::DecodeHintType;
|
27
|
+
using zxing::DecodeHints;
|
28
|
+
|
29
|
+
// VC++
|
30
|
+
using zxing::BarcodeFormat;
|
31
|
+
|
32
|
+
const DecodeHintType DecodeHints::CHARACTER_SET;
|
33
|
+
|
34
|
+
const DecodeHints DecodeHints::PRODUCT_HINT(
|
35
|
+
UPC_A_HINT |
|
36
|
+
UPC_E_HINT |
|
37
|
+
EAN_13_HINT |
|
38
|
+
EAN_8_HINT |
|
39
|
+
RSS_14_HINT
|
40
|
+
);
|
41
|
+
|
42
|
+
const DecodeHints DecodeHints::ONED_HINT(
|
43
|
+
CODE_39_HINT |
|
44
|
+
CODE_93_HINT |
|
45
|
+
CODE_128_HINT |
|
46
|
+
ITF_HINT |
|
47
|
+
CODABAR_HINT |
|
48
|
+
DecodeHints::PRODUCT_HINT
|
49
|
+
);
|
50
|
+
|
51
|
+
const DecodeHints DecodeHints::DEFAULT_HINT(
|
52
|
+
ONED_HINT |
|
53
|
+
QR_CODE_HINT |
|
54
|
+
DATA_MATRIX_HINT |
|
55
|
+
AZTEC_HINT |
|
56
|
+
PDF_417_HINT
|
57
|
+
);
|
58
|
+
|
59
|
+
DecodeHints::DecodeHints() {
|
60
|
+
hints = 0;
|
61
|
+
}
|
62
|
+
|
63
|
+
DecodeHints::DecodeHints(DecodeHintType init) {
|
64
|
+
hints = init;
|
65
|
+
}
|
66
|
+
|
67
|
+
void DecodeHints::addFormat(BarcodeFormat toadd) {
|
68
|
+
switch (toadd) {
|
69
|
+
case BarcodeFormat::AZTEC: hints |= AZTEC_HINT; break;
|
70
|
+
case BarcodeFormat::CODABAR: hints |= CODABAR_HINT; break;
|
71
|
+
case BarcodeFormat::CODE_39: hints |= CODE_39_HINT; break;
|
72
|
+
case BarcodeFormat::CODE_93: hints |= CODE_93_HINT; break;
|
73
|
+
case BarcodeFormat::CODE_128: hints |= CODE_128_HINT; break;
|
74
|
+
case BarcodeFormat::DATA_MATRIX: hints |= DATA_MATRIX_HINT; break;
|
75
|
+
case BarcodeFormat::EAN_8: hints |= EAN_8_HINT; break;
|
76
|
+
case BarcodeFormat::EAN_13: hints |= EAN_13_HINT; break;
|
77
|
+
case BarcodeFormat::ITF: hints |= ITF_HINT; break;
|
78
|
+
case BarcodeFormat::MAXICODE: hints |= MAXICODE_HINT; break;
|
79
|
+
case BarcodeFormat::PDF_417: hints |= PDF_417_HINT; break;
|
80
|
+
case BarcodeFormat::QR_CODE: hints |= QR_CODE_HINT; break;
|
81
|
+
case BarcodeFormat::RSS_14: hints |= RSS_14_HINT; break;
|
82
|
+
case BarcodeFormat::RSS_EXPANDED: hints |= RSS_EXPANDED_HINT; break;
|
83
|
+
case BarcodeFormat::UPC_A: hints |= UPC_A_HINT; break;
|
84
|
+
case BarcodeFormat::UPC_E: hints |= UPC_E_HINT; break;
|
85
|
+
case BarcodeFormat::UPC_EAN_EXTENSION: hints |= UPC_EAN_EXTENSION_HINT; break;
|
86
|
+
default: throw IllegalArgumentException("Unrecognizd barcode format");
|
87
|
+
}
|
88
|
+
}
|
89
|
+
|
90
|
+
bool DecodeHints::containsFormat(BarcodeFormat tocheck) const {
|
91
|
+
DecodeHintType checkAgainst = 0;
|
92
|
+
switch (tocheck) {
|
93
|
+
case BarcodeFormat::AZTEC: checkAgainst |= AZTEC_HINT; break;
|
94
|
+
case BarcodeFormat::CODABAR: checkAgainst |= CODABAR_HINT; break;
|
95
|
+
case BarcodeFormat::CODE_39: checkAgainst |= CODE_39_HINT; break;
|
96
|
+
case BarcodeFormat::CODE_93: checkAgainst |= CODE_93_HINT; break;
|
97
|
+
case BarcodeFormat::CODE_128: checkAgainst |= CODE_128_HINT; break;
|
98
|
+
case BarcodeFormat::DATA_MATRIX: checkAgainst |= DATA_MATRIX_HINT; break;
|
99
|
+
case BarcodeFormat::EAN_8: checkAgainst |= EAN_8_HINT; break;
|
100
|
+
case BarcodeFormat::EAN_13: checkAgainst |= EAN_13_HINT; break;
|
101
|
+
case BarcodeFormat::ITF: checkAgainst |= ITF_HINT; break;
|
102
|
+
case BarcodeFormat::MAXICODE: checkAgainst |= MAXICODE_HINT; break;
|
103
|
+
case BarcodeFormat::PDF_417: checkAgainst |= PDF_417_HINT; break;
|
104
|
+
case BarcodeFormat::QR_CODE: checkAgainst |= QR_CODE_HINT; break;
|
105
|
+
case BarcodeFormat::RSS_14: checkAgainst |= RSS_14_HINT; break;
|
106
|
+
case BarcodeFormat::RSS_EXPANDED: checkAgainst |= RSS_EXPANDED_HINT; break;
|
107
|
+
case BarcodeFormat::UPC_A: checkAgainst |= UPC_A_HINT; break;
|
108
|
+
case BarcodeFormat::UPC_E: checkAgainst |= UPC_E_HINT; break;
|
109
|
+
case BarcodeFormat::UPC_EAN_EXTENSION: checkAgainst |= UPC_EAN_EXTENSION_HINT; break;
|
110
|
+
default: throw IllegalArgumentException("Unrecognizd barcode format");
|
111
|
+
}
|
112
|
+
return (hints & checkAgainst) != 0;
|
113
|
+
}
|
114
|
+
|
115
|
+
void DecodeHints::setTryHarder(bool toset) {
|
116
|
+
if (toset) {
|
117
|
+
hints |= TRYHARDER_HINT;
|
118
|
+
} else {
|
119
|
+
hints &= ~TRYHARDER_HINT;
|
120
|
+
}
|
121
|
+
}
|
122
|
+
|
123
|
+
bool DecodeHints::getTryHarder() const {
|
124
|
+
return (hints & TRYHARDER_HINT) != 0;
|
125
|
+
}
|
126
|
+
|
127
|
+
void DecodeHints::setResultPointCallback(Ref<ResultPointCallback> const& _callback) {
|
128
|
+
callback = _callback;
|
129
|
+
}
|
130
|
+
|
131
|
+
Ref<ResultPointCallback> DecodeHints::getResultPointCallback() const {
|
132
|
+
return callback;
|
133
|
+
}
|
134
|
+
|
135
|
+
DecodeHints zxing::operator | (DecodeHints const& l, DecodeHints const& r) {
|
136
|
+
DecodeHints result (l);
|
137
|
+
result.hints |= r.hints;
|
138
|
+
if (!result.callback) {
|
139
|
+
result.callback = r.callback;
|
140
|
+
}
|
141
|
+
return result;
|
142
|
+
}
|