Add conditional builds in pro (#141)

* first refactoring on QZXing.pri to group sources based on type of barcode and operation

* Moved the newly created source code groups of functionalities to separate pri file (QZXing-components.pri).

* In QZXing.pri include QZXing-components.pri having previously added as configuration all the available modules to preserve the backward compatibility.

* Deactivate parts of code based on the configuration of the pro file. (Work in Progress).

* fix compilation error

* Fix include issue when only "enable_encoder_qr_code" config is used through QZXing-components.pri

Update example projects to use QZXing-components.pri
This commit is contained in:
Nikolaos Ftylitakis 2019-10-03 15:56:14 +03:00 committed by GitHub
parent 1d1fd56d7e
commit 6070e98f38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 634 additions and 532 deletions

View File

@ -28,4 +28,6 @@ qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
include(../../src/QZXing.pri)
CONFIG += enable_encoder_qr_code
include(../../src/QZXing-components.pri)

View File

@ -5,7 +5,12 @@ folder_01.target = qml
QT += widgets
CONFIG += qzxing_qml
CONFIG += qzxing_qml \
enable_decoder_1d_barcodes \
enable_decoder_qr_code \
enable_decoder_data_matrix \
enable_decoder_aztec \
enable_decoder_pdf17
# Additional import path used to resolve QML modules in Creator's code model
QML_IMPORT_PATH =
@ -38,7 +43,7 @@ SOURCES += main.cpp \
droparea.cpp
# Please do not modify the following two lines. Required for deployment.
include(../../src/QZXing.pri)
include(../../src/QZXing-components.pri)
if(lessThan(QT_VERSION, 5.0)): {
include(qmlapplicationviewer/qmlapplicationviewer.pri)

View File

@ -1,6 +1,11 @@
TEMPLATE = app
CONFIG += qzxing_multimedia
CONFIG += qzxing_multimedia \
enable_decoder_1d_barcodes \
enable_decoder_qr_code \
enable_decoder_data_matrix \
enable_decoder_aztec \
enable_decoder_pdf17
CONFIG(debug, debug|release) {
CONFIG+=qml_debug
@ -22,7 +27,7 @@ RESOURCES += qml.qrc
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =
include(../../src/QZXing.pri)
include(../../src/QZXing-components.pri)
# Default rules for deployment.
include(deployment.pri)

499
src/QZXing-components.pri Normal file
View File

@ -0,0 +1,499 @@
#
# Copyright 2011 QZXing authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
CONFIG += qt warn_on
DEFINES += QZXING_LIBRARY \
ZXING_ICONV_CONST \
DISABLE_LIBRARY_FEATURES
INCLUDEPATH += $$PWD \
$$PWD/zxing
HEADERS += $$PWD/QZXing_global.h \
$$PWD/CameraImageWrapper.h \
$$PWD/ImageHandler.h \
$$PWD/QZXing.h \
$$PWD/zxing/zxing/ZXing.h \
$$PWD/zxing/zxing/IllegalStateException.h \
$$PWD/zxing/zxing/InvertedLuminanceSource.h \
$$PWD/zxing/zxing/ChecksumException.h \
$$PWD/zxing/zxing/ResultPointCallback.h \
$$PWD/zxing/zxing/ResultPoint.h \
$$PWD/zxing/zxing/Result.h \
$$PWD/zxing/zxing/ResultMetadata.h \
$$PWD/zxing/zxing/ReaderException.h \
$$PWD/zxing/zxing/Reader.h \
$$PWD/zxing/zxing/NotFoundException.h \
$$PWD/zxing/zxing/MultiFormatReader.h \
$$PWD/zxing/zxing/LuminanceSource.h \
$$PWD/zxing/zxing/FormatException.h \
$$PWD/zxing/zxing/Exception.h \
$$PWD/zxing/zxing/DecodeHints.h \
$$PWD/zxing/zxing/BinaryBitmap.h \
$$PWD/zxing/zxing/Binarizer.h \
$$PWD/zxing/zxing/BarcodeFormat.h \
$$PWD/zxing/zxing/common/StringUtils.h \
$$PWD/zxing/zxing/common/Str.h \
$$PWD/zxing/zxing/common/Point.h \
$$PWD/zxing/zxing/common/PerspectiveTransform.h \
$$PWD/zxing/zxing/common/IllegalArgumentException.h \
$$PWD/zxing/zxing/common/HybridBinarizer.h \
$$PWD/zxing/zxing/common/GridSampler.h \
$$PWD/zxing/zxing/common/GreyscaleRotatedLuminanceSource.h \
$$PWD/zxing/zxing/common/GreyscaleLuminanceSource.h \
$$PWD/zxing/zxing/common/GlobalHistogramBinarizer.h \
$$PWD/zxing/zxing/common/DetectorResult.h \
$$PWD/zxing/zxing/common/DecoderResult.h \
$$PWD/zxing/zxing/common/Counted.h \
$$PWD/zxing/zxing/common/CharacterSetECI.h \
$$PWD/zxing/zxing/common/BitSource.h \
$$PWD/zxing/zxing/common/BitMatrix.h \
$$PWD/zxing/zxing/common/BitArray.h \
$$PWD/zxing/zxing/common/Array.h \
$$PWD/zxing/zxing/common/detector/MathUtils.h \
$$PWD/zxing/zxing/common/detector/JavaMath.h \
$$PWD/zxing/zxing/common/detector/WhiteRectangleDetector.h \
$$PWD/zxing/zxing/common/detector/MonochromeRectangleDetector.h \
$$PWD/zxing/zxing/common/reedsolomon/ReedSolomonException.h \
$$PWD/zxing/zxing/common/reedsolomon/ReedSolomonDecoder.h \
$$PWD/zxing/zxing/common/reedsolomon/GenericGFPoly.h \
$$PWD/zxing/zxing/common/reedsolomon/GenericGF.h \
$$PWD/zxing/zxing/common/ByteArray.h \
$$PWD/zxing/zxing/multi/MultipleBarcodeReader.h \
$$PWD/zxing/zxing/multi/GenericMultipleBarcodeReader.h \
$$PWD/zxing/zxing/multi/ByQuadrantReader.h \
$$PWD/zxing/bigint/NumberlikeArray.hh \
$$PWD/zxing/bigint/BigUnsignedInABase.hh \
$$PWD/zxing/bigint/BigUnsigned.hh \
$$PWD/zxing/bigint/BigIntegerUtils.hh \
$$PWD/zxing/bigint/BigIntegerLibrary.hh \
$$PWD/zxing/bigint/BigIntegerAlgorithms.hh \
$$PWD/zxing/bigint/BigInteger.hh \
$$PWD/zxing/zxing/WriterException.h \
$$PWD/zxing/zxing/common/Types.h
SOURCES += $$PWD/CameraImageWrapper.cpp \
$$PWD/QZXing.cpp \
$$PWD/ImageHandler.cpp \
$$PWD/zxing/zxing/ResultIO.cpp \
$$PWD/zxing/zxing/InvertedLuminanceSource.cpp \
$$PWD/zxing/zxing/ChecksumException.cpp \
$$PWD/zxing/zxing/ResultPointCallback.cpp \
$$PWD/zxing/zxing/ResultPoint.cpp \
$$PWD/zxing/zxing/Result.cpp \
$$PWD/zxing/zxing/ResultMetadata.cpp \
$$PWD/zxing/zxing/Reader.cpp \
$$PWD/zxing/zxing/MultiFormatReader.cpp \
$$PWD/zxing/zxing/LuminanceSource.cpp \
$$PWD/zxing/zxing/FormatException.cpp \
$$PWD/zxing/zxing/Exception.cpp \
$$PWD/zxing/zxing/DecodeHints.cpp \
$$PWD/zxing/zxing/BinaryBitmap.cpp \
$$PWD/zxing/zxing/Binarizer.cpp \
$$PWD/zxing/zxing/BarcodeFormat.cpp \
$$PWD/zxing/zxing/ReaderException.cpp \
$$PWD/zxing/zxing/IllegalStateException.cpp \
$$PWD/zxing/zxing/NotFoundException.cpp \
$$PWD/zxing/zxing/WriterException.cpp \
$$PWD/zxing/zxing/common/Counted.cpp \
$$PWD/zxing/zxing/common/StringUtils.cpp \
$$PWD/zxing/zxing/common/Str.cpp \
$$PWD/zxing/zxing/common/PerspectiveTransform.cpp \
$$PWD/zxing/zxing/common/IllegalArgumentException.cpp \
$$PWD/zxing/zxing/common/HybridBinarizer.cpp \
$$PWD/zxing/zxing/common/GridSampler.cpp \
$$PWD/zxing/zxing/common/GreyscaleRotatedLuminanceSource.cpp \
$$PWD/zxing/zxing/common/GreyscaleLuminanceSource.cpp \
$$PWD/zxing/zxing/common/GlobalHistogramBinarizer.cpp \
$$PWD/zxing/zxing/common/DetectorResult.cpp \
$$PWD/zxing/zxing/common/DecoderResult.cpp \
$$PWD/zxing/zxing/common/CharacterSetECI.cpp \
$$PWD/zxing/zxing/common/BitSource.cpp \
$$PWD/zxing/zxing/common/BitMatrix.cpp \
$$PWD/zxing/zxing/common/BitArray.cpp \
$$PWD/zxing/zxing/common/BitArrayIO.cpp \
$$PWD/zxing/zxing/common/detector/WhiteRectangleDetector.cpp \
$$PWD/zxing/zxing/common/detector/MonochromeRectangleDetector.cpp \
$$PWD/zxing/zxing/common/reedsolomon/ReedSolomonException.cpp \
$$PWD/zxing/zxing/common/reedsolomon/ReedSolomonDecoder.cpp \
$$PWD/zxing/zxing/common/reedsolomon/GenericGFPoly.cpp \
$$PWD/zxing/zxing/common/reedsolomon/GenericGF.cpp \
$$PWD/zxing/zxing/multi/MultipleBarcodeReader.cpp \
$$PWD/zxing/zxing/multi/GenericMultipleBarcodeReader.cpp \
$$PWD/zxing/zxing/multi/ByQuadrantReader.cpp \
$$PWD/zxing/bigint/BigUnsignedInABase.cc \
$$PWD/zxing/bigint/BigUnsigned.cc \
$$PWD/zxing/bigint/BigIntegerUtils.cc \
$$PWD/zxing/bigint/BigIntegerAlgorithms.cc \
$$PWD/zxing/bigint/BigInteger.cc \
enable_decoder_1d_barcodes {
DEFINES += ENABLE_DECODER_1D_BARCODES
HEADERS += \
$$PWD/zxing/zxing/oned/UPCEReader.h \
$$PWD/zxing/zxing/oned/UPCEANReader.h \
$$PWD/zxing/zxing/oned/UPCEANExtensionSupport.h \
$$PWD/zxing/zxing/oned/UPCEANExtension2Support.h \
$$PWD/zxing/zxing/oned/UPCEANExtension5Support.h \
$$PWD/zxing/zxing/oned/UPCAReader.h \
$$PWD/zxing/zxing/oned/OneDResultPoint.h \
$$PWD/zxing/zxing/oned/OneDReader.h \
$$PWD/zxing/zxing/oned/MultiFormatUPCEANReader.h \
$$PWD/zxing/zxing/oned/MultiFormatOneDReader.h \
$$PWD/zxing/zxing/oned/ITFReader.h \
$$PWD/zxing/zxing/oned/EAN13Reader.h \
$$PWD/zxing/zxing/oned/EAN8Reader.h \
$$PWD/zxing/zxing/oned/EANManufacturerOrgSupport.h \
$$PWD/zxing/zxing/oned/Code128Reader.h \
$$PWD/zxing/zxing/oned/Code39Reader.h \
$$PWD/zxing/zxing/oned/CodaBarReader.h \
$$PWD/zxing/zxing/oned/Code93Reader.h \
$$PWD/zxing/zxing/oned/rss/AbstractRSSReader.h \
$$PWD/zxing/zxing/oned/rss/DataCharacter.h \
$$PWD/zxing/zxing/oned/rss/FinderPattern.h \
$$PWD/zxing/zxing/oned/rss/Pair.h \
$$PWD/zxing/zxing/oned/rss/RSS14Reader.h \
$$PWD/zxing/zxing/oned/rss/RSSUtils.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AbstractExpandedDecoder.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI013103decoder.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI01320xDecoder.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI01392xDecoder.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI01393xDecoder.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI013x0x1xDecoder.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI013x0xDecoder.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI01AndOtherAIs.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI01decoder.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI01weightDecoder.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AnyAIDecoder.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/BlockParsedResult.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/CurrentParsingState.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/DecodedChar.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/DecodedInformation.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/DecodedNumeric.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/DecodedObject.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/FieldParser.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/GeneralAppIdDecoder.h \
$$PWD/zxing/zxing/oned/rss/expanded/BitArrayBuilder.h \
$$PWD/zxing/zxing/oned/rss/expanded/ExpandedPair.h \
$$PWD/zxing/zxing/oned/rss/expanded/ExpandedRow.h \
$$PWD/zxing/zxing/oned/rss/expanded/RSSExpandedReader.h
SOURCES += \
$$PWD/zxing/zxing/oned/UPCEReader.cpp \
$$PWD/zxing/zxing/oned/UPCEANReader.cpp \
$$PWD/zxing/zxing/oned/UPCEANExtensionSupport.cpp \
$$PWD/zxing/zxing/oned/UPCEANExtension2Support.cpp \
$$PWD/zxing/zxing/oned/UPCEANExtension5Support.cpp \
$$PWD/zxing/zxing/oned/UPCAReader.cpp \
$$PWD/zxing/zxing/oned/OneDResultPoint.cpp \
$$PWD/zxing/zxing/oned/OneDReader.cpp \
$$PWD/zxing/zxing/oned/MultiFormatUPCEANReader.cpp \
$$PWD/zxing/zxing/oned/MultiFormatOneDReader.cpp \
$$PWD/zxing/zxing/oned/ITFReader.cpp \
$$PWD/zxing/zxing/oned/EAN13Reader.cpp \
$$PWD/zxing/zxing/oned/EAN8Reader.cpp \
$$PWD/zxing/zxing/oned/EANManufacturerOrgSupport.cpp \
$$PWD/zxing/zxing/oned/Code128Reader.cpp \
$$PWD/zxing/zxing/oned/Code39Reader.cpp \
$$PWD/zxing/zxing/oned/CodaBarReader.cpp \
$$PWD/zxing/zxing/oned/Code93Reader.cpp \
$$PWD/zxing/zxing/oned/rss/AbstractRSSReader.cpp \
$$PWD/zxing/zxing/oned/rss/DataCharacter.cpp \
$$PWD/zxing/zxing/oned/rss/FinderPattern.cpp \
$$PWD/zxing/zxing/oned/rss/Pair.cpp \
$$PWD/zxing/zxing/oned/rss/RSS14Reader.cpp \
$$PWD/zxing/zxing/oned/rss/RSSUtils.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/BitArrayBuilder.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/ExpandedPair.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/ExpandedRow.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/RSSExpandedReader.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AbstractExpandedDecoder.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI01AndOtherAIs.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI01decoder.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI01weightDecoder.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI013x0x1xDecoder.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI013x0xDecoder.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI01320xDecoder.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI01392xDecoder.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI01393xDecoder.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI013103decoder.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AnyAIDecoder.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/BlockParsedResult.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/CurrentParsingState.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/DecodedChar.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/DecodedInformation.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/DecodedNumeric.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/DecodedObject.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/FieldParser.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/GeneralAppIdDecoder.cpp
}
enable_decoder_qr_code {
DEFINES += ENABLE_DECODER_QR_CODE
CONFIG += enable_generic_qrcode
HEADERS += \
$$PWD/zxing/zxing/qrcode/decoder/Decoder.h \
$$PWD/zxing/zxing/qrcode/decoder/DecodedBitStreamParser.h \
$$PWD/zxing/zxing/qrcode/decoder/DataMask.h \
$$PWD/zxing/zxing/qrcode/decoder/DataBlock.h \
$$PWD/zxing/zxing/qrcode/decoder/BitMatrixParser.h \
$$PWD/zxing/zxing/qrcode/detector/FinderPatternInfo.h \
$$PWD/zxing/zxing/qrcode/detector/FinderPatternFinder.h \
$$PWD/zxing/zxing/qrcode/detector/FinderPattern.h \
$$PWD/zxing/zxing/qrcode/detector/Detector.h \
$$PWD/zxing/zxing/qrcode/detector/AlignmentPatternFinder.h \
$$PWD/zxing/zxing/qrcode/detector/AlignmentPattern.h \
$$PWD/zxing/zxing/multi/qrcode/QRCodeMultiReader.h \
$$PWD/zxing/zxing/multi/qrcode/detector/MultiFinderPatternFinder.h \
$$PWD/zxing/zxing/multi/qrcode/detector/MultiDetector.h \
SOURCES += \
$$PWD/zxing/zxing/qrcode/decoder/QRBitMatrixParser.cpp \
$$PWD/zxing/zxing/qrcode/decoder/QRDataBlock.cpp \
$$PWD/zxing/zxing/qrcode/decoder/QRDataMask.cpp \
$$PWD/zxing/zxing/qrcode/decoder/QRDecodedBitStreamParser.cpp \
$$PWD/zxing/zxing/qrcode/decoder/QRDecoder.cpp \
$$PWD/zxing/zxing/qrcode/detector/QRAlignmentPattern.cpp \
$$PWD/zxing/zxing/qrcode/detector/QRAlignmentPatternFinder.cpp \
$$PWD/zxing/zxing/qrcode/detector/QRDetector.cpp \
$$PWD/zxing/zxing/qrcode/detector/QRFinderPattern.cpp \
$$PWD/zxing/zxing/qrcode/detector/QRFinderPatternFinder.cpp \
$$PWD/zxing/zxing/qrcode/detector/QRFinderPatternInfo.cpp \
$$PWD/zxing/zxing/qrcode/QRCodeReader.cpp \
$$PWD/zxing/zxing/multi/qrcode/QRCodeMultiReader.cpp \
$$PWD/zxing/zxing/multi/qrcode/detector/MultiFinderPatternFinder.cpp \
$$PWD/zxing/zxing/multi/qrcode/detector/MultiDetector.cpp
}
enable_encoder_qr_code {
DEFINES += ENABLE_ENCODER_QR_CODE
CONFIG += enable_generic_qrcode \
enable_encoder_generic
HEADERS += \
$$PWD/zxing/zxing/qrcode/encoder/BlockPair.h \
$$PWD/zxing/zxing/qrcode/encoder/ByteMatrix.h \
$$PWD/zxing/zxing/qrcode/encoder/Encoder.h \
$$PWD/zxing/zxing/qrcode/encoder/MaskUtil.h \
$$PWD/zxing/zxing/qrcode/encoder/MatrixUtil.h \
$$PWD/zxing/zxing/qrcode/encoder/QRCode.h
SOURCES += \
$$PWD/zxing/zxing/qrcode/encoder/ByteMatrix.cpp \
$$PWD/zxing/zxing/qrcode/encoder/QREncoder.cpp \
$$PWD/zxing/zxing/qrcode/encoder/MaskUtil.cpp \
$$PWD/zxing/zxing/qrcode/encoder/MatrixUtil.cpp \
$$PWD/zxing/zxing/qrcode/encoder/QRCode.cpp
}
enable_decoder_data_matrix {
DEFINES += ENABLE_DECODER_DATA_MATRIX
HEADERS += \
$$PWD/zxing/zxing/datamatrix/Version.h \
$$PWD/zxing/zxing/datamatrix/DataMatrixReader.h \
$$PWD/zxing/zxing/datamatrix/decoder/Decoder.h \
$$PWD/zxing/zxing/datamatrix/decoder/DecodedBitStreamParser.h \
$$PWD/zxing/zxing/datamatrix/decoder/DataBlock.h \
$$PWD/zxing/zxing/datamatrix/decoder/BitMatrixParser.h \
$$PWD/zxing/zxing/datamatrix/detector/DetectorException.h \
$$PWD/zxing/zxing/datamatrix/detector/Detector.h \
$$PWD/zxing/zxing/datamatrix/detector/CornerPoint.h
SOURCES += \
$$PWD/zxing/zxing/datamatrix/DataMatrixReader.cpp \
$$PWD/zxing/zxing/datamatrix/DataMatrixVersion.cpp \
$$PWD/zxing/zxing/datamatrix/decoder/DataMatrixDecoder.cpp \
$$PWD/zxing/zxing/datamatrix/decoder/DataMatrixBitMatrixParser.cpp \
$$PWD/zxing/zxing/datamatrix/decoder/DataMatrixDataBlock.cpp \
$$PWD/zxing/zxing/datamatrix/decoder/DataMatrixDecodedBitStreamParser.cpp \
$$PWD/zxing/zxing/datamatrix/detector/DataMatrixCornerPoint.cpp \
$$PWD/zxing/zxing/datamatrix/detector/DataMatrixDetector.cpp \
$$PWD/zxing/zxing/datamatrix/detector/DataMatrixDetectorException.cpp
}
enable_decoder_aztec {
DEFINES += ENABLE_DECODER_AZTEC
HEADERS += \
$$PWD/zxing/zxing/aztec/AztecReader.h \
$$PWD/zxing/zxing/aztec/AztecDetectorResult.h \
$$PWD/zxing/zxing/aztec/decoder/Decoder.h \
$$PWD/zxing/zxing/aztec/detector/Detector.h
SOURCES += \
$$PWD/zxing/zxing/aztec/AztecReader.cpp \
$$PWD/zxing/zxing/aztec/AztecDetectorResult.cpp \
$$PWD/zxing/zxing/aztec/decoder/AztecDecoder.cpp \
$$PWD/zxing/zxing/aztec/detector/AztecDetector.cpp
}
enable_decoder_pdf17 {
DEFINES += ENABLE_DECODER_PDF17
HEADERS += \
$$PWD/zxing/zxing/pdf417/decoder/ec/ErrorCorrection.h \
$$PWD/zxing/zxing/pdf417/decoder/ec/ModulusGF.h \
$$PWD/zxing/zxing/pdf417/decoder/ec/ModulusPoly.h \
$$PWD/zxing/zxing/pdf417/decoder/BitMatrixParser.h \
$$PWD/zxing/zxing/pdf417/decoder/DecodedBitStreamParser.h \
$$PWD/zxing/zxing/pdf417/decoder/Decoder.h \
$$PWD/zxing/zxing/pdf417/detector/Detector.h \
$$PWD/zxing/zxing/pdf417/detector/LinesSampler.h \
$$PWD/zxing/zxing/pdf417/PDF417Reader.h
SOURCES += \
$$PWD/zxing/zxing/pdf417/decoder/ec/ErrorCorrection.cpp \
$$PWD/zxing/zxing/pdf417/decoder/ec/ModulusGF.cpp \
$$PWD/zxing/zxing/pdf417/decoder/ec/ModulusPoly.cpp \
$$PWD/zxing/zxing/pdf417/decoder/PDF417BitMatrixParser.cpp \
$$PWD/zxing/zxing/pdf417/decoder/PDF417DecodedBitStreamParser.cpp \
$$PWD/zxing/zxing/pdf417/decoder/PDF417Decoder.cpp \
$$PWD/zxing/zxing/pdf417/detector/PDF417Detector.cpp \
$$PWD/zxing/zxing/pdf417/detector/LinesSampler.cpp \
$$PWD/zxing/zxing/pdf417/PDF417Reader.cpp
}
enable_generic_qrcode {
CONFIG += enable_encoder_generic
HEADERS += \
$$PWD/zxing/zxing/qrcode/Version.h \
$$PWD/zxing/zxing/qrcode/QRCodeReader.h \
$$PWD/zxing/zxing/qrcode/FormatInformation.h \
$$PWD/zxing/zxing/qrcode/ErrorCorrectionLevel.h \
$$PWD/zxing/zxing/qrcode/decoder/Mode.h
SOURCES += \
$$PWD/zxing/zxing/qrcode/QRVersion.cpp \
$$PWD/zxing/zxing/qrcode/QRFormatInformation.cpp \
$$PWD/zxing/zxing/qrcode/QRErrorCorrectionLevel.cpp \
$$PWD/zxing/zxing/qrcode/decoder/QRMode.cpp \
}
enable_encoder_generic {
DEFINES += ENABLE_ENCODER_GENERIC
HEADERS += \
$$PWD/zxing/zxing/EncodeHint.h \
$$PWD/zxing/zxing/UnsupportedEncodingException.h \
$$PWD/zxing/zxing/common/reedsolomon/ReedSolomonEncoder.h \
SOURCES += \
$$PWD/zxing/zxing/EncodeHint.cpp \
$$PWD/zxing/zxing/UnsupportedEncodingException.cpp \
$$PWD/zxing/zxing/common/reedsolomon/ReedSolomonEncoder.cpp
}
qzxing_multimedia {
QT += multimedia
CONFIG += qzxing_qml
DEFINES += QZXING_MULTIMEDIA
HEADERS += \
$$PWD/QZXingFilter.h
SOURCES += \
$$PWD/QZXingFilter.cpp
}
qzxing_qml {
greaterThan(QT_VERSION, 4.7): lessThan(QT_VERSION, 5.0): QT += declarative
greaterThan(QT_MAJOR_VERSION, 4): QT += quick
DEFINES += QZXING_QML
HEADERS += \
$$PWD/QZXingImageProvider.h
SOURCES += \
$$PWD/QZXingImageProvider.cpp
}
symbian {
TARGET.UID3 = 0xE618743C
TARGET.EPOCALLOWDLLDATA = 1
#TARGET.CAPABILITY = All -TCB -AllFiles -DRM
TARGET.CAPABILITY += NetworkServices \
ReadUserData \
WriteUserData \
LocalServices \
UserEnvironment \
Location
}
!symbian {
isEmpty(PREFIX) {
maemo5 {
target.path = /opt/usr/lib
} else {
target.path = /usr/lib
}
}
DEFINES += NOFMAXL
# Installation
headers.files = qzxing.h QZXing_global.h
headers.path = $$PREFIX/include
target.path = $$PREFIX/lib
INSTALLS += headers target
# pkg-config support
CONFIG += create_pc create_prl no_install_prl
QMAKE_PKGCONFIG_DESTDIR = pkgconfig
QMAKE_PKGCONFIG_LIBDIR = ${prefix}/lib
QMAKE_PKGCONFIG_INCDIR = ${prefix}/include
unix:QMAKE_CLEAN += -r pkgconfig lib$${TARGET}.prl
}
win32-msvc*{
DEFINES += __STDC_LIMIT_MACROS
INCLUDEPATH += $$PWD/zxing/win32/zxing \
$$PWD/zxing/win32/zxing/msvc
HEADERS += $$PWD/zxing/win32/zxing/msvc/stdint.h \
$$PWD/zxing/win32/zxing/iconv.h
SOURCES += $$PWD/zxing/win32/zxing/win_iconv.c
}
win32-g++{
INCLUDEPATH += $$PWD/zxing/win32/zxing
HEADERS += $$PWD/zxing/win32/zxing/iconv.h
SOURCES += $$PWD/zxing/win32/zxing/win_iconv.c
}
!win32{
DEFINES += NO_ICONV
}
winrt {
DEFINES += NO_ICONV
}

View File

@ -6,18 +6,21 @@
#include <zxing/MultiFormatReader.h>
#include <zxing/DecodeHints.h>
#include <zxing/ResultMetadata.h>
#include <zxing/common/detector/WhiteRectangleDetector.h>
#include "CameraImageWrapper.h"
#include "ImageHandler.h"
#include <QTime>
#include <QUrl>
#include <QFileInfo>
#include <zxing/qrcode/encoder/Encoder.h>
#include <zxing/qrcode/ErrorCorrectionLevel.h>
#include <zxing/common/detector/WhiteRectangleDetector.h>
#include <QColor>
#include <QtCore/QTextCodec>
#include <QDebug>
#ifdef ENABLE_ENCODER_QR_CODE
#include <zxing/qrcode/encoder/Encoder.h>
#include <zxing/qrcode/ErrorCorrectionLevel.h>
#endif // ENABLE_ENCODER_QR_CODE
#if QT_VERSION >= 0x040700 && QT_VERSION < 0x050000
#include <QtDeclarative>
#elif QT_VERSION >= 0x050000
@ -572,6 +575,7 @@ QString QZXing::decodeSubImageQML(const QUrl &imageUrl,
#endif //QZXING_QML
}
#ifdef ENABLE_ENCODER_GENERIC
QImage QZXing::encodeData(const QString& data,
const EncoderFormat encoderFormat,
const QSize encoderImageSize,
@ -591,6 +595,7 @@ QImage QZXing::encodeData(const QString &data, const QZXingEncoderConfig &encode
try {
switch (encoderConfig.format) {
#ifdef ENABLE_ENCODER_QR_CODE
case EncoderFormat_QR_CODE:
{
Ref<qrcode::QRCode> barcode = qrcode::Encoder::encode(
@ -626,6 +631,7 @@ QImage QZXing::encodeData(const QString &data, const QZXingEncoderConfig &encode
image = image.scaled(encoderConfig.imageSize);
break;
}
#endif // ENABLE_ENCODER_QR_CODE
case EncoderFormat_INVALID:
break;
}
@ -635,6 +641,7 @@ QImage QZXing::encodeData(const QString &data, const QZXingEncoderConfig &encode
return image;
}
#endif // ENABLE_ENCODER_GENERIC
int QZXing::getProcessTimeOfLastDecoding()
{

View File

@ -36,7 +36,10 @@ class MultiFormatReader;
class ResultMetadata;
}
class ImageHandler;
#ifdef ENABLE_ENCODER_GENERIC
struct QZXingEncoderConfig;
#endif // ENABLE_ENCODER_GENERIC
/**
* A class containing a very very small subset of the ZXing library.
@ -177,6 +180,7 @@ public slots:
const int offsetX = 0, const int offsetY = 0,
const int width = 0, const int height = 0);
#ifdef ENABLE_ENCODER_GENERIC
/**
* The main encoding function. Currently supports only Qr code encoding
*/
@ -191,6 +195,7 @@ public slots:
const QSize encoderImageSize = QSize(240, 240),
const EncodeErrorCorrectionLevel errorCorrectionLevel = EncodeErrorCorrectionLevel_L,
const bool border = false);
#endif // ENABLE_ENCODER_GENERIC
/**
* Get the prossecing time in millisecond of the last decode operation.
@ -238,6 +243,7 @@ private:
bool isThreaded;
};
#ifdef ENABLE_ENCODER_GENERIC
typedef struct QZXingEncoderConfig
{
QZXing::EncoderFormat format;
@ -252,6 +258,7 @@ typedef struct QZXingEncoderConfig
format(encoderFormat_), imageSize(encoderImageSize_),
errorCorrectionLevel(errorCorrectionLevel_), border(border_) {}
} QZXingEncoderConfig;
#endif // ENABLE_ENCODER_GENERIC
#endif // QZXING_H

View File

@ -1,429 +1,10 @@
#
# Copyright 2011 QZXing authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#For backward compatibility, when using QZXing.pri, enable the complete
# library functionality
CONFIG += enable_decoder_1d_barcodes \
enable_decoder_qr_code \
enable_decoder_data_matrix \
enable_decoder_aztec \
enable_decoder_pdf17 \
enable_encoder_qr_code
CONFIG += qt warn_on
DEFINES += QZXING_LIBRARY \
ZXING_ICONV_CONST \
DISABLE_LIBRARY_FEATURES
INCLUDEPATH += $$PWD \
$$PWD/zxing
HEADERS += $$PWD/QZXing_global.h \
$$PWD/CameraImageWrapper.h \
$$PWD/ImageHandler.h \
$$PWD/QZXing.h \
$$PWD/zxing/zxing/ZXing.h \
$$PWD/zxing/zxing/IllegalStateException.h \
$$PWD/zxing/zxing/InvertedLuminanceSource.h \
$$PWD/zxing/zxing/ChecksumException.h \
$$PWD/zxing/zxing/ResultPointCallback.h \
$$PWD/zxing/zxing/ResultPoint.h \
$$PWD/zxing/zxing/Result.h \
$$PWD/zxing/zxing/ResultMetadata.h \
$$PWD/zxing/zxing/ReaderException.h \
$$PWD/zxing/zxing/Reader.h \
$$PWD/zxing/zxing/NotFoundException.h \
$$PWD/zxing/zxing/MultiFormatReader.h \
$$PWD/zxing/zxing/LuminanceSource.h \
$$PWD/zxing/zxing/FormatException.h \
$$PWD/zxing/zxing/Exception.h \
$$PWD/zxing/zxing/DecodeHints.h \
$$PWD/zxing/zxing/BinaryBitmap.h \
$$PWD/zxing/zxing/Binarizer.h \
$$PWD/zxing/zxing/BarcodeFormat.h \
$$PWD/zxing/zxing/aztec/AztecReader.h \
$$PWD/zxing/zxing/aztec/AztecDetectorResult.h \
$$PWD/zxing/zxing/aztec/decoder/Decoder.h \
$$PWD/zxing/zxing/aztec/detector/Detector.h \
$$PWD/zxing/zxing/common/StringUtils.h \
$$PWD/zxing/zxing/common/Str.h \
$$PWD/zxing/zxing/common/Point.h \
$$PWD/zxing/zxing/common/PerspectiveTransform.h \
$$PWD/zxing/zxing/common/IllegalArgumentException.h \
$$PWD/zxing/zxing/common/HybridBinarizer.h \
$$PWD/zxing/zxing/common/GridSampler.h \
$$PWD/zxing/zxing/common/GreyscaleRotatedLuminanceSource.h \
$$PWD/zxing/zxing/common/GreyscaleLuminanceSource.h \
$$PWD/zxing/zxing/common/GlobalHistogramBinarizer.h \
$$PWD/zxing/zxing/common/DetectorResult.h \
$$PWD/zxing/zxing/common/DecoderResult.h \
$$PWD/zxing/zxing/common/Counted.h \
$$PWD/zxing/zxing/common/CharacterSetECI.h \
$$PWD/zxing/zxing/common/BitSource.h \
$$PWD/zxing/zxing/common/BitMatrix.h \
$$PWD/zxing/zxing/common/BitArray.h \
$$PWD/zxing/zxing/common/Array.h \
$$PWD/zxing/zxing/common/detector/MathUtils.h \
$$PWD/zxing/zxing/common/detector/JavaMath.h \
$$PWD/zxing/zxing/common/detector/WhiteRectangleDetector.h \
$$PWD/zxing/zxing/common/detector/MonochromeRectangleDetector.h \
$$PWD/zxing/zxing/common/reedsolomon/ReedSolomonException.h \
$$PWD/zxing/zxing/common/reedsolomon/ReedSolomonDecoder.h \
$$PWD/zxing/zxing/common/reedsolomon/GenericGFPoly.h \
$$PWD/zxing/zxing/common/reedsolomon/GenericGF.h \
$$PWD/zxing/zxing/common/ByteArray.h \
$$PWD/zxing/zxing/datamatrix/Version.h \
$$PWD/zxing/zxing/datamatrix/DataMatrixReader.h \
$$PWD/zxing/zxing/datamatrix/decoder/Decoder.h \
$$PWD/zxing/zxing/datamatrix/decoder/DecodedBitStreamParser.h \
$$PWD/zxing/zxing/datamatrix/decoder/DataBlock.h \
$$PWD/zxing/zxing/datamatrix/decoder/BitMatrixParser.h \
$$PWD/zxing/zxing/datamatrix/detector/DetectorException.h \
$$PWD/zxing/zxing/datamatrix/detector/Detector.h \
$$PWD/zxing/zxing/datamatrix/detector/CornerPoint.h \
$$PWD/zxing/zxing/oned/UPCEReader.h \
$$PWD/zxing/zxing/oned/UPCEANReader.h \
$$PWD/zxing/zxing/oned/UPCEANExtensionSupport.h \
$$PWD/zxing/zxing/oned/UPCEANExtension2Support.h \
$$PWD/zxing/zxing/oned/UPCEANExtension5Support.h \
$$PWD/zxing/zxing/oned/UPCAReader.h \
$$PWD/zxing/zxing/oned/OneDResultPoint.h \
$$PWD/zxing/zxing/oned/OneDReader.h \
$$PWD/zxing/zxing/oned/MultiFormatUPCEANReader.h \
$$PWD/zxing/zxing/oned/MultiFormatOneDReader.h \
$$PWD/zxing/zxing/oned/ITFReader.h \
$$PWD/zxing/zxing/oned/EAN13Reader.h \
$$PWD/zxing/zxing/oned/EAN8Reader.h \
$$PWD/zxing/zxing/oned/EANManufacturerOrgSupport.h \
$$PWD/zxing/zxing/oned/Code128Reader.h \
$$PWD/zxing/zxing/oned/Code39Reader.h \
$$PWD/zxing/zxing/oned/CodaBarReader.h \
$$PWD/zxing/zxing/oned/Code93Reader.h \
$$PWD/zxing/zxing/oned/rss/AbstractRSSReader.h \
$$PWD/zxing/zxing/oned/rss/DataCharacter.h \
$$PWD/zxing/zxing/oned/rss/FinderPattern.h \
$$PWD/zxing/zxing/oned/rss/Pair.h \
$$PWD/zxing/zxing/oned/rss/RSS14Reader.h \
$$PWD/zxing/zxing/oned/rss/RSSUtils.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AbstractExpandedDecoder.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI013103decoder.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI01320xDecoder.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI01392xDecoder.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI01393xDecoder.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI013x0x1xDecoder.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI013x0xDecoder.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI01AndOtherAIs.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI01decoder.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI01weightDecoder.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AnyAIDecoder.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/BlockParsedResult.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/CurrentParsingState.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/DecodedChar.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/DecodedInformation.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/DecodedNumeric.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/DecodedObject.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/FieldParser.h \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/GeneralAppIdDecoder.h \
$$PWD/zxing/zxing/oned/rss/expanded/BitArrayBuilder.h \
$$PWD/zxing/zxing/oned/rss/expanded/ExpandedPair.h \
$$PWD/zxing/zxing/oned/rss/expanded/ExpandedRow.h \
$$PWD/zxing/zxing/oned/rss/expanded/RSSExpandedReader.h \
$$PWD/zxing/zxing/qrcode/Version.h \
$$PWD/zxing/zxing/qrcode/QRCodeReader.h \
$$PWD/zxing/zxing/qrcode/FormatInformation.h \
$$PWD/zxing/zxing/qrcode/ErrorCorrectionLevel.h \
$$PWD/zxing/zxing/qrcode/decoder/Mode.h \
$$PWD/zxing/zxing/qrcode/decoder/Decoder.h \
$$PWD/zxing/zxing/qrcode/decoder/DecodedBitStreamParser.h \
$$PWD/zxing/zxing/qrcode/decoder/DataMask.h \
$$PWD/zxing/zxing/qrcode/decoder/DataBlock.h \
$$PWD/zxing/zxing/qrcode/decoder/BitMatrixParser.h \
$$PWD/zxing/zxing/qrcode/detector/FinderPatternInfo.h \
$$PWD/zxing/zxing/qrcode/detector/FinderPatternFinder.h \
$$PWD/zxing/zxing/qrcode/detector/FinderPattern.h \
$$PWD/zxing/zxing/qrcode/detector/Detector.h \
$$PWD/zxing/zxing/qrcode/detector/AlignmentPatternFinder.h \
$$PWD/zxing/zxing/qrcode/detector/AlignmentPattern.h \
$$PWD/zxing/zxing/multi/MultipleBarcodeReader.h \
$$PWD/zxing/zxing/multi/GenericMultipleBarcodeReader.h \
$$PWD/zxing/zxing/multi/ByQuadrantReader.h \
$$PWD/zxing/zxing/multi/qrcode/QRCodeMultiReader.h \
$$PWD/zxing/zxing/multi/qrcode/detector/MultiFinderPatternFinder.h \
$$PWD/zxing/zxing/multi/qrcode/detector/MultiDetector.h \
$$PWD/zxing/zxing/pdf417/decoder/ec/ErrorCorrection.h \
$$PWD/zxing/zxing/pdf417/decoder/ec/ModulusGF.h \
$$PWD/zxing/zxing/pdf417/decoder/ec/ModulusPoly.h \
$$PWD/zxing/zxing/pdf417/decoder/BitMatrixParser.h \
$$PWD/zxing/zxing/pdf417/decoder/DecodedBitStreamParser.h \
$$PWD/zxing/zxing/pdf417/decoder/Decoder.h \
$$PWD/zxing/zxing/pdf417/detector/Detector.h \
$$PWD/zxing/zxing/pdf417/detector/LinesSampler.h \
$$PWD/zxing/zxing/pdf417/PDF417Reader.h \
$$PWD/zxing/bigint/NumberlikeArray.hh \
$$PWD/zxing/bigint/BigUnsignedInABase.hh \
$$PWD/zxing/bigint/BigUnsigned.hh \
$$PWD/zxing/bigint/BigIntegerUtils.hh \
$$PWD/zxing/bigint/BigIntegerLibrary.hh \
$$PWD/zxing/bigint/BigIntegerAlgorithms.hh \
$$PWD/zxing/bigint/BigInteger.hh \
$$PWD/zxing/zxing/qrcode/encoder/BlockPair.h \
$$PWD/zxing/zxing/qrcode/encoder/ByteMatrix.h \
$$PWD/zxing/zxing/qrcode/encoder/Encoder.h \
$$PWD/zxing/zxing/qrcode/encoder/MaskUtil.h \
$$PWD/zxing/zxing/qrcode/encoder/MatrixUtil.h \
$$PWD/zxing/zxing/qrcode/encoder/QRCode.h \
$$PWD/zxing/zxing/WriterException.h \
$$PWD/zxing/zxing/EncodeHint.h \
$$PWD/zxing/zxing/UnsupportedEncodingException.h \
$$PWD/zxing/zxing/common/reedsolomon/ReedSolomonEncoder.h \
$$PWD/zxing/zxing/common/Types.h
SOURCES += $$PWD/CameraImageWrapper.cpp \
$$PWD/QZXing.cpp \
$$PWD/ImageHandler.cpp \
$$PWD/zxing/zxing/ResultIO.cpp \
$$PWD/zxing/zxing/InvertedLuminanceSource.cpp \
$$PWD/zxing/zxing/ChecksumException.cpp \
$$PWD/zxing/zxing/ResultPointCallback.cpp \
$$PWD/zxing/zxing/ResultPoint.cpp \
$$PWD/zxing/zxing/Result.cpp \
$$PWD/zxing/zxing/ResultMetadata.cpp \
$$PWD/zxing/zxing/Reader.cpp \
$$PWD/zxing/zxing/MultiFormatReader.cpp \
$$PWD/zxing/zxing/LuminanceSource.cpp \
$$PWD/zxing/zxing/FormatException.cpp \
$$PWD/zxing/zxing/Exception.cpp \
$$PWD/zxing/zxing/DecodeHints.cpp \
$$PWD/zxing/zxing/BinaryBitmap.cpp \
$$PWD/zxing/zxing/Binarizer.cpp \
$$PWD/zxing/zxing/BarcodeFormat.cpp \
$$PWD/zxing/zxing/ReaderException.cpp \
$$PWD/zxing/zxing/IllegalStateException.cpp \
$$PWD/zxing/zxing/NotFoundException.cpp \
$$PWD/zxing/zxing/UnsupportedEncodingException.cpp \
$$PWD/zxing/zxing/WriterException.cpp \
$$PWD/zxing/zxing/aztec/AztecReader.cpp \
$$PWD/zxing/zxing/aztec/AztecDetectorResult.cpp \
$$PWD/zxing/zxing/common/Counted.cpp \
$$PWD/zxing/zxing/common/StringUtils.cpp \
$$PWD/zxing/zxing/common/Str.cpp \
$$PWD/zxing/zxing/common/PerspectiveTransform.cpp \
$$PWD/zxing/zxing/common/IllegalArgumentException.cpp \
$$PWD/zxing/zxing/common/HybridBinarizer.cpp \
$$PWD/zxing/zxing/common/GridSampler.cpp \
$$PWD/zxing/zxing/common/GreyscaleRotatedLuminanceSource.cpp \
$$PWD/zxing/zxing/common/GreyscaleLuminanceSource.cpp \
$$PWD/zxing/zxing/common/GlobalHistogramBinarizer.cpp \
$$PWD/zxing/zxing/common/DetectorResult.cpp \
$$PWD/zxing/zxing/common/DecoderResult.cpp \
$$PWD/zxing/zxing/common/CharacterSetECI.cpp \
$$PWD/zxing/zxing/common/BitSource.cpp \
$$PWD/zxing/zxing/common/BitMatrix.cpp \
$$PWD/zxing/zxing/common/BitArray.cpp \
$$PWD/zxing/zxing/common/BitArrayIO.cpp \
$$PWD/zxing/zxing/common/detector/WhiteRectangleDetector.cpp \
$$PWD/zxing/zxing/common/detector/MonochromeRectangleDetector.cpp \
$$PWD/zxing/zxing/common/reedsolomon/ReedSolomonException.cpp \
$$PWD/zxing/zxing/common/reedsolomon/ReedSolomonDecoder.cpp \
$$PWD/zxing/zxing/common/reedsolomon/GenericGFPoly.cpp \
$$PWD/zxing/zxing/common/reedsolomon/GenericGF.cpp \
$$PWD/zxing/zxing/datamatrix/DataMatrixReader.cpp \
$$PWD/zxing/zxing/oned/UPCEReader.cpp \
$$PWD/zxing/zxing/oned/UPCEANReader.cpp \
$$PWD/zxing/zxing/oned/UPCEANExtensionSupport.cpp \
$$PWD/zxing/zxing/oned/UPCEANExtension2Support.cpp \
$$PWD/zxing/zxing/oned/UPCEANExtension5Support.cpp \
$$PWD/zxing/zxing/oned/UPCAReader.cpp \
$$PWD/zxing/zxing/oned/OneDResultPoint.cpp \
$$PWD/zxing/zxing/oned/OneDReader.cpp \
$$PWD/zxing/zxing/oned/MultiFormatUPCEANReader.cpp \
$$PWD/zxing/zxing/oned/MultiFormatOneDReader.cpp \
$$PWD/zxing/zxing/oned/ITFReader.cpp \
$$PWD/zxing/zxing/oned/EAN13Reader.cpp \
$$PWD/zxing/zxing/oned/EAN8Reader.cpp \
$$PWD/zxing/zxing/oned/EANManufacturerOrgSupport.cpp \
$$PWD/zxing/zxing/oned/Code128Reader.cpp \
$$PWD/zxing/zxing/oned/Code39Reader.cpp \
$$PWD/zxing/zxing/oned/CodaBarReader.cpp \
$$PWD/zxing/zxing/oned/Code93Reader.cpp \
$$PWD/zxing/zxing/oned/rss/AbstractRSSReader.cpp \
$$PWD/zxing/zxing/oned/rss/DataCharacter.cpp \
$$PWD/zxing/zxing/oned/rss/FinderPattern.cpp \
$$PWD/zxing/zxing/oned/rss/Pair.cpp \
$$PWD/zxing/zxing/oned/rss/RSS14Reader.cpp \
$$PWD/zxing/zxing/oned/rss/RSSUtils.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/BitArrayBuilder.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/ExpandedPair.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/ExpandedRow.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/RSSExpandedReader.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AbstractExpandedDecoder.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI01AndOtherAIs.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI01decoder.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI01weightDecoder.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI013x0x1xDecoder.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI013x0xDecoder.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI01320xDecoder.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI01392xDecoder.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI01393xDecoder.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AI013103decoder.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/AnyAIDecoder.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/BlockParsedResult.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/CurrentParsingState.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/DecodedChar.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/DecodedInformation.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/DecodedNumeric.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/DecodedObject.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/FieldParser.cpp \
$$PWD/zxing/zxing/oned/rss/expanded/decoders/GeneralAppIdDecoder.cpp \
$$PWD/zxing/zxing/qrcode/QRCodeReader.cpp \
$$PWD/zxing/zxing/multi/MultipleBarcodeReader.cpp \
$$PWD/zxing/zxing/multi/GenericMultipleBarcodeReader.cpp \
$$PWD/zxing/zxing/multi/ByQuadrantReader.cpp \
$$PWD/zxing/zxing/multi/qrcode/QRCodeMultiReader.cpp \
$$PWD/zxing/zxing/multi/qrcode/detector/MultiFinderPatternFinder.cpp \
$$PWD/zxing/zxing/multi/qrcode/detector/MultiDetector.cpp \
$$PWD/zxing/zxing/aztec/decoder/AztecDecoder.cpp \
$$PWD/zxing/zxing/aztec/detector/AztecDetector.cpp \
$$PWD/zxing/zxing/datamatrix/DataMatrixVersion.cpp \
$$PWD/zxing/zxing/datamatrix/decoder/DataMatrixDecoder.cpp \
$$PWD/zxing/zxing/datamatrix/decoder/DataMatrixBitMatrixParser.cpp \
$$PWD/zxing/zxing/datamatrix/decoder/DataMatrixDataBlock.cpp \
$$PWD/zxing/zxing/datamatrix/decoder/DataMatrixDecodedBitStreamParser.cpp \
$$PWD/zxing/zxing/datamatrix/detector/DataMatrixCornerPoint.cpp \
$$PWD/zxing/zxing/datamatrix/detector/DataMatrixDetector.cpp \
$$PWD/zxing/zxing/datamatrix/detector/DataMatrixDetectorException.cpp \
$$PWD/zxing/zxing/qrcode/decoder/QRBitMatrixParser.cpp \
$$PWD/zxing/zxing/qrcode/decoder/QRDataBlock.cpp \
$$PWD/zxing/zxing/qrcode/decoder/QRDataMask.cpp \
$$PWD/zxing/zxing/qrcode/decoder/QRDecodedBitStreamParser.cpp \
$$PWD/zxing/zxing/qrcode/decoder/QRDecoder.cpp \
$$PWD/zxing/zxing/qrcode/decoder/QRMode.cpp \
$$PWD/zxing/zxing/qrcode/detector/QRAlignmentPattern.cpp \
$$PWD/zxing/zxing/qrcode/detector/QRAlignmentPatternFinder.cpp \
$$PWD/zxing/zxing/qrcode/detector/QRDetector.cpp \
$$PWD/zxing/zxing/qrcode/detector/QRFinderPattern.cpp \
$$PWD/zxing/zxing/qrcode/detector/QRFinderPatternFinder.cpp \
$$PWD/zxing/zxing/qrcode/detector/QRFinderPatternInfo.cpp \
$$PWD/zxing/zxing/qrcode/QRVersion.cpp \
$$PWD/zxing/zxing/qrcode/QRFormatInformation.cpp \
$$PWD/zxing/zxing/qrcode/QRErrorCorrectionLevel.cpp \
$$PWD/zxing/zxing/pdf417/decoder/ec/ErrorCorrection.cpp \
$$PWD/zxing/zxing/pdf417/decoder/ec/ModulusGF.cpp \
$$PWD/zxing/zxing/pdf417/decoder/ec/ModulusPoly.cpp \
$$PWD/zxing/zxing/pdf417/decoder/PDF417BitMatrixParser.cpp \
$$PWD/zxing/zxing/pdf417/decoder/PDF417DecodedBitStreamParser.cpp \
$$PWD/zxing/zxing/pdf417/decoder/PDF417Decoder.cpp \
$$PWD/zxing/zxing/pdf417/detector/PDF417Detector.cpp \
$$PWD/zxing/zxing/pdf417/detector/LinesSampler.cpp \
$$PWD/zxing/zxing/pdf417/PDF417Reader.cpp \
$$PWD/zxing/bigint/BigUnsignedInABase.cc \
$$PWD/zxing/bigint/BigUnsigned.cc \
$$PWD/zxing/bigint/BigIntegerUtils.cc \
$$PWD/zxing/bigint/BigIntegerAlgorithms.cc \
$$PWD/zxing/bigint/BigInteger.cc \
$$PWD/zxing/zxing/qrcode/encoder/ByteMatrix.cpp \
$$PWD/zxing/zxing/qrcode/encoder/QREncoder.cpp \
$$PWD/zxing/zxing/qrcode/encoder/MaskUtil.cpp \
$$PWD/zxing/zxing/qrcode/encoder/MatrixUtil.cpp \
$$PWD/zxing/zxing/qrcode/encoder/QRCode.cpp \
$$PWD/zxing/zxing/EncodeHint.cpp \
$$PWD/zxing/zxing/common/reedsolomon/ReedSolomonEncoder.cpp
qzxing_multimedia {
QT += multimedia
CONFIG += qzxing_qml
DEFINES += QZXING_MULTIMEDIA
HEADERS += \
$$PWD/QZXingFilter.h
SOURCES += \
$$PWD/QZXingFilter.cpp
}
qzxing_qml {
greaterThan(QT_VERSION, 4.7): lessThan(QT_VERSION, 5.0): QT += declarative
greaterThan(QT_MAJOR_VERSION, 4): QT += quick
DEFINES += QZXING_QML
HEADERS += \
$$PWD/QZXingImageProvider.h
SOURCES += \
$$PWD/QZXingImageProvider.cpp
}
symbian {
TARGET.UID3 = 0xE618743C
TARGET.EPOCALLOWDLLDATA = 1
#TARGET.CAPABILITY = All -TCB -AllFiles -DRM
TARGET.CAPABILITY += NetworkServices \
ReadUserData \
WriteUserData \
LocalServices \
UserEnvironment \
Location
}
!symbian {
isEmpty(PREFIX) {
maemo5 {
target.path = /opt/usr/lib
} else {
target.path = /usr/lib
}
}
DEFINES += NOFMAXL
# Installation
headers.files = qzxing.h QZXing_global.h
headers.path = $$PREFIX/include
target.path = $$PREFIX/lib
INSTALLS += headers target
# pkg-config support
CONFIG += create_pc create_prl no_install_prl
QMAKE_PKGCONFIG_DESTDIR = pkgconfig
QMAKE_PKGCONFIG_LIBDIR = ${prefix}/lib
QMAKE_PKGCONFIG_INCDIR = ${prefix}/include
unix:QMAKE_CLEAN += -r pkgconfig lib$${TARGET}.prl
}
win32-msvc*{
DEFINES += __STDC_LIMIT_MACROS
INCLUDEPATH += $$PWD/zxing/win32/zxing \
$$PWD/zxing/win32/zxing/msvc
HEADERS += $$PWD/zxing/win32/zxing/msvc/stdint.h \
$$PWD/zxing/win32/zxing/iconv.h
SOURCES += $$PWD/zxing/win32/zxing/win_iconv.c
}
win32-g++{
INCLUDEPATH += $$PWD/zxing/win32/zxing
HEADERS += $$PWD/zxing/win32/zxing/iconv.h
SOURCES += $$PWD/zxing/win32/zxing/win_iconv.c
}
!win32{
DEFINES += NO_ICONV
}
winrt {
DEFINES += NO_ICONV
}
include(./QZXing-components.pri)

View File

@ -14,55 +14,22 @@
# limitations under the License.
#
include(QZXing.pri)
CONFIG += \
enable_decoder_1d_barcodes \
enable_decoder_qr_code \
enable_decoder_data_matrix \
enable_decoder_aztec \
enable_decoder_pdf17 \
enable_encoder_qr_code
#staticlib
#qzxing_qml
#qzxing_multimedia
VERSION = 2.3
TARGET = QZXing
TEMPLATE = lib
# CONFIG += staticlib
DEFINES -= DISABLE_LIBRARY_FEATURES
symbian {
TARGET.UID3 = 0xE618743C
TARGET.EPOCALLOWDLLDATA = 1
addFiles.sources = QZXing.dll
addFiles.path = !:/sys/bin
DEPLOYMENT += addFiles
# TARGET.CAPABILITY = All -TCB -AllFiles -DRM
TARGET.CAPABILITY += NetworkServices \
ReadUserData \
WriteUserData \
LocalServices \
UserEnvironment \
Location
}
OTHER_FILES += \
qtc_packaging/debian_fremantle/rules \
qtc_packaging/debian_fremantle/README \
qtc_packaging/debian_fremantle/copyright \
qtc_packaging/debian_fremantle/control \
qtc_packaging/debian_fremantle/compat \
qtc_packaging/debian_fremantle/changelog \
qtc_packaging/debian_harmattan/rules \
qtc_packaging/debian_harmattan/README \
qtc_packaging/debian_harmattan/manifest.aegis \
qtc_packaging/debian_harmattan/copyright \
qtc_packaging/debian_harmattan/control \
qtc_packaging/debian_harmattan/compat \
qtc_packaging/debian_harmattan/changelog \
qtc_packaging/debian_harmattan/rules \
qtc_packaging/debian_harmattan/README \
qtc_packaging/debian_harmattan/manifest.aegis \
qtc_packaging/debian_harmattan/copyright \
qtc_packaging/debian_harmattan/control \
qtc_packaging/debian_harmattan/compat \
qtc_packaging/debian_harmattan/changelog \
qtc_packaging/debian_fremantle/rules \
qtc_packaging/debian_fremantle/README \
qtc_packaging/debian_fremantle/copyright \
qtc_packaging/debian_fremantle/control \
qtc_packaging/debian_fremantle/compat \
qtc_packaging/debian_fremantle/changelog
include(QZXing-components.pri)

View File

@ -15,15 +15,31 @@
* limitations under the License.
*/
#include <zxing/ZXing.h>
#include <zxing/MultiFormatReader.h>
#include <zxing/qrcode/QRCodeReader.h>
#include <zxing/datamatrix/DataMatrixReader.h>
#include <zxing/aztec/AztecReader.h>
#include <zxing/pdf417/PDF417Reader.h>
#include <zxing/oned/MultiFormatUPCEANReader.h>
#include <zxing/oned/MultiFormatOneDReader.h>
#include <zxing/ReaderException.h>
#include <zxing/ZXing.h>
#ifdef ENABLE_DECODER_AZTEC
#include <zxing/aztec/AztecReader.h>
#endif // ENABLE_DECODER_AZTEC
#ifdef ENABLE_DECODER_DATA_MATRIX
#include <zxing/datamatrix/DataMatrixReader.h>
#endif // ENABLE_DECODER_DATA_MATRIX
#ifdef ENABLE_DECODER_1D_BARCODES
#include <zxing/oned/MultiFormatOneDReader.h>
#include <zxing/oned/MultiFormatUPCEANReader.h>
#endif // ENABLE_DECODER_1D_BARCODES
#ifdef ENABLE_DECODER_PDF17
#include <zxing/pdf417/PDF417Reader.h>
#endif // ENABLE_DECODER_PDF17
#ifdef ENABLE_DECODER_QR_CODE
#include <zxing/qrcode/QRCodeReader.h>
#endif // ENABLE_DECODER_QR_CODE
using zxing::Ref;
using zxing::Result;
@ -56,57 +72,69 @@ Ref<Result> MultiFormatReader::decodeWithState(Ref<BinaryBitmap> image) {
void MultiFormatReader::setHints(DecodeHints hints) {
hints_ = hints;
readers_.clear();
bool tryHarder = hints.getTryHarder();
bool addOneDReader = hints.containsFormat(BarcodeFormat::UPC_E) ||
hints.containsFormat(BarcodeFormat::UPC_A) ||
hints.containsFormat(BarcodeFormat::UPC_E) ||
hints.containsFormat(BarcodeFormat::EAN_13) ||
hints.containsFormat(BarcodeFormat::EAN_8) ||
hints.containsFormat(BarcodeFormat::CODABAR) ||
hints.containsFormat(BarcodeFormat::CODE_39) ||
hints.containsFormat(BarcodeFormat::CODE_93) ||
hints.containsFormat(BarcodeFormat::CODE_128) ||
hints.containsFormat(BarcodeFormat::ITF) ||
hints.containsFormat(BarcodeFormat::RSS_14) ||
hints.containsFormat(BarcodeFormat::RSS_EXPANDED);
if (addOneDReader && !tryHarder) {
readers_.push_back(Ref<Reader>(new zxing::oned::MultiFormatOneDReader(hints)));
}
if (hints.containsFormat(BarcodeFormat::QR_CODE)) {
readers_.push_back(Ref<Reader>(new zxing::qrcode::QRCodeReader()));
}
if (hints.containsFormat(BarcodeFormat::DATA_MATRIX)) {
readers_.push_back(Ref<Reader>(new zxing::datamatrix::DataMatrixReader()));
}
if (hints.containsFormat(BarcodeFormat::AZTEC)) {
readers_.push_back(Ref<Reader>(new zxing::aztec::AztecReader()));
}
if (hints.containsFormat(BarcodeFormat::PDF_417)) {
readers_.push_back(Ref<Reader>(new zxing::pdf417::PDF417Reader()));
}
/*
if (hints.contains(BarcodeFormat.MAXICODE)) {
readers.add(new MaxiCodeReader());
}
*/
if (addOneDReader && tryHarder) {
readers_.push_back(Ref<Reader>(new zxing::oned::MultiFormatOneDReader(hints)));
}
if (readers_.size() == 0) {
if (!tryHarder) {
enableReaders(hints, false);
if (readers_.size() == 0)
enableReaders(hints, true);
}
void MultiFormatReader::enableReaders(zxing::DecodeHints hints, bool allowAll)
{
bool tryHarder = hints.getTryHarder();
bool addOneDReader = hints.containsFormat(BarcodeFormat::UPC_E) ||
hints.containsFormat(BarcodeFormat::UPC_A) ||
hints.containsFormat(BarcodeFormat::UPC_E) ||
hints.containsFormat(BarcodeFormat::EAN_13) ||
hints.containsFormat(BarcodeFormat::EAN_8) ||
hints.containsFormat(BarcodeFormat::CODABAR) ||
hints.containsFormat(BarcodeFormat::CODE_39) ||
hints.containsFormat(BarcodeFormat::CODE_93) ||
hints.containsFormat(BarcodeFormat::CODE_128) ||
hints.containsFormat(BarcodeFormat::ITF) ||
hints.containsFormat(BarcodeFormat::RSS_14) ||
hints.containsFormat(BarcodeFormat::RSS_EXPANDED);
#ifdef ENABLE_DECODER_1D_BARCODES
if ((allowAll || addOneDReader) && !tryHarder) {
readers_.push_back(Ref<Reader>(new zxing::oned::MultiFormatOneDReader(hints)));
}
readers_.push_back(Ref<Reader>(new zxing::qrcode::QRCodeReader()));
readers_.push_back(Ref<Reader>(new zxing::datamatrix::DataMatrixReader()));
readers_.push_back(Ref<Reader>(new zxing::aztec::AztecReader()));
readers_.push_back(Ref<Reader>(new zxing::pdf417::PDF417Reader()));
// readers.add(new MaxiCodeReader());
#endif
if (tryHarder) {
#ifdef ENABLE_DECODER_QR_CODE
if (allowAll || hints.containsFormat(BarcodeFormat::QR_CODE)) {
readers_.push_back(Ref<Reader>(new zxing::qrcode::QRCodeReader()));
}
#endif
#ifdef ENABLE_DECODER_DATA_MATRIX
if (allowAll || hints.containsFormat(BarcodeFormat::DATA_MATRIX)) {
readers_.push_back(Ref<Reader>(new zxing::datamatrix::DataMatrixReader()));
}
#endif
#ifdef ENABLE_DECODER_AZTEC
if (allowAll || hints.containsFormat(BarcodeFormat::AZTEC)) {
readers_.push_back(Ref<Reader>(new zxing::aztec::AztecReader()));
}
#endif
#ifdef ENABLE_DECODER_PDF17
if (allowAll || hints.containsFormat(BarcodeFormat::PDF_417)) {
readers_.push_back(Ref<Reader>(new zxing::pdf417::PDF417Reader()));
}
#endif
/*
if (hints.contains(BarcodeFormat.MAXICODE)) {
readers.add(new MaxiCodeReader());
}
*/
#ifdef ENABLE_DECODER_1D_BARCODES
if ((allowAll || addOneDReader) && tryHarder) {
readers_.push_back(Ref<Reader>(new zxing::oned::MultiFormatOneDReader(hints)));
}
}
#endif
}
Ref<Result> MultiFormatReader::decodeInternal(Ref<BinaryBitmap> image) {

View File

@ -41,6 +41,7 @@ namespace zxing {
Ref<Result> decode(Ref<BinaryBitmap> image, DecodeHints hints);
Ref<Result> decodeWithState(Ref<BinaryBitmap> image);
void setHints(DecodeHints hints);
void enableReaders(DecodeHints hints, bool allowAll = false);
~MultiFormatReader();
};
}