diff --git a/examples/QQrDecoder/QQrDecoder.cpp b/examples/QQrDecoder/QQrDecoder.cpp index 9473169..c74a04d 100644 --- a/examples/QQrDecoder/QQrDecoder.cpp +++ b/examples/QQrDecoder/QQrDecoder.cpp @@ -41,6 +41,7 @@ QQrDecoder::QQrDecoder(QWidget *parent): QMainWindow(parent), decoder(this) ui.setupUi(this); connect(ui.centralwidget, SIGNAL(imageCaptured(QImage)), this, SLOT(decodeImage(QImage))); connect(&decoder, SIGNAL(tagFound(QString)), this, SLOT(reportTagFound(QString))); + //decoder.setDecoder( QZXing::DecoderFormat_DATA_MATRIX);//DecoderFormat_QR_CODE | DecoderFormat_EAN_13 ); } QQrDecoder::~QQrDecoder() diff --git a/examples/QQrDecoder/QQrDecoder.h b/examples/QQrDecoder/QQrDecoder.h index dfca86e..d56ecc4 100644 --- a/examples/QQrDecoder/QQrDecoder.h +++ b/examples/QQrDecoder/QQrDecoder.h @@ -36,8 +36,6 @@ #include "ui_QQrDecoder.h" #include -#include "CameraImageWrapper.h" - class QQrDecoder : public QMainWindow { Q_OBJECT diff --git a/examples/QQrDecoder/QQrDecoder.pro b/examples/QQrDecoder/QQrDecoder.pro index 6820e84..ee5a6ac 100644 --- a/examples/QQrDecoder/QQrDecoder.pro +++ b/examples/QQrDecoder/QQrDecoder.pro @@ -43,12 +43,6 @@ symbian{ " " DEPLOYMENT += customrules } -else{ - DEFINES += NO_ICONV -} - - -DEFINES += ZXING_ICONV_CONST ICON = QQrDecoder.svg diff --git a/examples/QQrDecoder/QQrDecoder.rss b/examples/QQrDecoder/QQrDecoder.rss new file mode 100644 index 0000000..1443bf9 --- /dev/null +++ b/examples/QQrDecoder/QQrDecoder.rss @@ -0,0 +1,22 @@ +// ============================================================================ +// * Generated by qmake (2.01a) (Qt 4.7.3) on: 2011-11-26T14:57:01 +// * This file is generated by qmake and should not be modified by the +// * user. +// ============================================================================ + +CHARACTER_SET UTF8 +#include +#include "QQrDecoder.loc" + +RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info + { + short_caption = STRING_r_short_caption; + caption_and_icon = + CAPTION_AND_ICON_INFO + { + caption = STRING_r_caption; + number_of_icons = 1; + icon_file = "\\resource\\apps\\QQrDecoder.mif"; + }; + } + diff --git a/examples/QQrDecoder/QQrDecoder.sis b/examples/QQrDecoder/QQrDecoder.sis index 28fbd9e..1176957 100644 Binary files a/examples/QQrDecoder/QQrDecoder.sis and b/examples/QQrDecoder/QQrDecoder.sis differ diff --git a/examples/QQrDecoder/QQrDecoder_reg.rss b/examples/QQrDecoder/QQrDecoder_reg.rss new file mode 100644 index 0000000..4caad53 --- /dev/null +++ b/examples/QQrDecoder/QQrDecoder_reg.rss @@ -0,0 +1,18 @@ +// ============================================================================ +// * Generated by qmake (2.01a) (Qt 4.7.3) on: 2011-11-26T14:57:01 +// * This file is generated by qmake and should not be modified by the +// * user. +// ============================================================================ + +#include +#include + +UID2 KUidAppRegistrationResourceFile +UID3 0xEF2CE79D + +RESOURCE APP_REGISTRATION_INFO + { + app_file="QQrDecoder"; + localisable_resource_file="\\resource\\apps\\QQrDecoder"; + + } diff --git a/examples/QQrDecoder/qzxing.h b/examples/QQrDecoder/qzxing.h index 78797c1..e312fff 100644 --- a/examples/QQrDecoder/qzxing.h +++ b/examples/QQrDecoder/qzxing.h @@ -5,6 +5,10 @@ #include #include +#if QT_VERSION >= 0x040700 +#include +#endif + /** * A class containing a very very small subset of the ZXing library. * Created for ease of use. @@ -15,20 +19,22 @@ * Regarding DecoderFormat, by default all of those are enabled (except DataMatrix will is still not supported) */ class QZXINGSHARED_EXPORT QZXing : public QObject{ -Q_OBJECT + Q_OBJECT + Q_ENUMS(DecoderFormat) public: enum DecoderFormat { DecoderFormat_None = 0, - DecoderFormat_QR_CODE, - DecoderFormat_DATA_MATRIX, - DecoderFormat_UPC_E, - DecoderFormat_UPC_A, - DecoderFormat_EAN_8, - DecoderFormat_EAN_13, - DecoderFormat_CODE_128, - DecoderFormat_CODE_39, - DecoderFormat_ITF + DecoderFormat_QR_CODE = 1, + DecoderFormat_DATA_MATRIX = 2, + DecoderFormat_UPC_E = 4, + DecoderFormat_UPC_A = 8, + DecoderFormat_EAN_8 = 16, + DecoderFormat_EAN_13 = 32, + DecoderFormat_CODE_128 = 64, + DecoderFormat_CODE_39 = 128, + DecoderFormat_ITF = 256 } ; + typedef unsigned int DecoderFormatType; public: QZXing(QObject *parent = NULL); @@ -38,7 +44,14 @@ public: * As argument it is possible to pass conjuction of decoders by using logic OR. * e.x. setDecoder ( DecoderFormat_QR_CODE | DecoderFormat_EAN_13 | DecoderFormat_CODE_39 ) */ - void setDecoder(DecoderFormat hint); + void setDecoder(DecoderFormatType hint); + +#if QT_VERSION >= 0x040700 + static void registerQMLTypes() + { + qmlRegisterType("QZXing", 1, 0, "QZXing"); + } +#endif public slots: /** @@ -54,6 +67,7 @@ signals: private: void* decoder; + DecoderFormatType supportedFormats; }; #endif // QZXING_H diff --git a/examples/QQrDecoder/qzxing.sis b/examples/QQrDecoder/qzxing.sis deleted file mode 100644 index b6265c2..0000000 Binary files a/examples/QQrDecoder/qzxing.sis and /dev/null differ diff --git a/source/QZXing.h b/source/QZXing.h index e802e9d..e312fff 100644 --- a/source/QZXing.h +++ b/source/QZXing.h @@ -24,16 +24,17 @@ class QZXINGSHARED_EXPORT QZXing : public QObject{ public: enum DecoderFormat { DecoderFormat_None = 0, - DecoderFormat_QR_CODE, - DecoderFormat_DATA_MATRIX, - DecoderFormat_UPC_E, - DecoderFormat_UPC_A, - DecoderFormat_EAN_8, - DecoderFormat_EAN_13, - DecoderFormat_CODE_128, - DecoderFormat_CODE_39, - DecoderFormat_ITF + DecoderFormat_QR_CODE = 1, + DecoderFormat_DATA_MATRIX = 2, + DecoderFormat_UPC_E = 4, + DecoderFormat_UPC_A = 8, + DecoderFormat_EAN_8 = 16, + DecoderFormat_EAN_13 = 32, + DecoderFormat_CODE_128 = 64, + DecoderFormat_CODE_39 = 128, + DecoderFormat_ITF = 256 } ; + typedef unsigned int DecoderFormatType; public: QZXing(QObject *parent = NULL); @@ -43,7 +44,7 @@ public: * As argument it is possible to pass conjuction of decoders by using logic OR. * e.x. setDecoder ( DecoderFormat_QR_CODE | DecoderFormat_EAN_13 | DecoderFormat_CODE_39 ) */ - void setDecoder(DecoderFormat hint); + void setDecoder(DecoderFormatType hint); #if QT_VERSION >= 0x040700 static void registerQMLTypes() @@ -66,6 +67,7 @@ signals: private: void* decoder; + DecoderFormatType supportedFormats; }; #endif // QZXING_H diff --git a/source/QZXing.pro b/source/QZXing.pro index 4795136..62e8bea 100644 --- a/source/QZXing.pro +++ b/source/QZXing.pro @@ -33,6 +33,7 @@ HEADERS += zxing/BarcodeFormat.h \ zxing/ResultPoint.h \ zxing/ResultPointCallback.h \ zxing/FormatException.h \ + zxing/NotFoundException.h \ zxing/common/StringUtils.h \ zxing/common/CharacterSetECI.h \ zxing/common/ECI.h \ @@ -57,6 +58,8 @@ HEADERS += zxing/BarcodeFormat.h \ zxing/common/reedsolomon/GF256Poly.h \ zxing/common/reedsolomon/ReedSolomonDecoder.h \ zxing/common/reedsolomon/ReedSolomonException.h \ + zxing/common/detector/MonochromeRectangleDetector.h \ + zxing/common/detector/WhiteRectangleDetector.h \ zxing/oned/Code128Reader.h \ zxing/oned/Code39Reader.h \ zxing/oned/EAN13Reader.h \ @@ -86,6 +89,16 @@ HEADERS += zxing/BarcodeFormat.h \ zxing/qrcode/detector/FinderPatternFinder.h \ zxing/qrcode/detector/FinderPatternInfo.h \ zxing/qrcode/detector/QREdgeDetector.h \ + zxing/datamatrix/VersionDM.h \ + zxing/datamatrix/DataMatrixReader.h \ + zxing/datamatrix/decoder/BitMatrixParserDM.h \ + zxing/datamatrix/decoder/DataBlockDM.h \ + zxing/datamatrix/decoder/DecodedBitStreamParserDM.h \ + zxing/datamatrix/decoder/DecoderDM.h \ + zxing/datamatrix/detector/CornerPoint.h \ + zxing/datamatrix/detector/DetectorDM.h \ + zxing/datamatrix/detector/DetectorException.h \ + zxing/datamatrix/detector/MonochromeRectangleDetectorDM.h \ QZXing_global.h \ CameraImageWrapper.h \ qzxing.h @@ -103,6 +116,7 @@ SOURCES += zxing/BarcodeFormat.cpp \ zxing/ResultPoint.cpp \ zxing/ResultPointCallback.cpp \ zxing/FormatException.cpp \ + zxing/NotFoundException.cpp \ zxing/common/StringUtils.cpp \ zxing/common/CharacterSetECI.cpp \ zxing/common/ECI.cpp \ @@ -126,6 +140,8 @@ SOURCES += zxing/BarcodeFormat.cpp \ zxing/common/reedsolomon/GF256Poly.cpp \ zxing/common/reedsolomon/ReedSolomonDecoder.cpp \ zxing/common/reedsolomon/ReedSolomonException.cpp \ + zxing/common/detector/MonochromeRectangleDetector.cpp \ + zxing/common/detector/WhiteRectangleDetector.cpp \ zxing/oned/Code128Reader.cpp \ zxing/oned/Code39Reader.cpp \ zxing/oned/EAN13Reader.cpp \ @@ -155,23 +171,33 @@ SOURCES += zxing/BarcodeFormat.cpp \ zxing/qrcode/detector/FinderPatternFinder.cpp \ zxing/qrcode/detector/FinderPatternInfo.cpp \ zxing/qrcode/detector/QREdgeDetector.cpp \ + zxing/datamatrix/VersionDM.cpp \ + zxing/datamatrix/DataMatrixReader.cpp \ + zxing/datamatrix/decoder/BitMatrixParserDM.cpp \ + zxing/datamatrix/decoder/DataBlockDM.cpp\ + zxing/datamatrix/decoder/DecodedBitStreamParserDM.cpp \ + zxing/datamatrix/decoder/DecoderDM.cpp \ + zxing/datamatrix/detector/CornerPoint.cpp \ + zxing/datamatrix/detector/DetectorDM.cpp \ + zxing/datamatrix/detector/DetectorException.cpp \ + zxing/datamatrix/detector/MonochromeRectangleDetectorDM.cpp \ CameraImageWrapper.cpp \ qzxing.cpp symbian { - MMP_RULES += EXPORTUNFROZEN + #MMP_RULES += EXPORTUNFROZEN 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 + #TARGET.CAPABILITY = All -TCB -AllFiles -DRM + TARGET.CAPABILITY += NetworkServices \ + ReadUserData \ + WriteUserData \ + LocalServices \ + UserEnvironment \ + Location } unix:!symbian { diff --git a/source/QZXing.sis b/source/QZXing.sis new file mode 100644 index 0000000..838b2aa Binary files /dev/null and b/source/QZXing.sis differ diff --git a/source/QZXing_global.h b/source/QZXing_global.h index 645c94a..617e77b 100644 --- a/source/QZXing_global.h +++ b/source/QZXing_global.h @@ -9,8 +9,4 @@ # define QZXINGSHARED_EXPORT Q_DECL_IMPORT #endif -#if defined(MSVC2008) - kyguig -#endif - #endif // QZXING_GLOBAL_H diff --git a/source/eabi/QZXingu.def b/source/eabi/QZXingu.def deleted file mode 100644 index e96c697..0000000 --- a/source/eabi/QZXingu.def +++ /dev/null @@ -1,92 +0,0 @@ -EXPORTS - _ZN6QZXing10setDecoderENS_13DecoderFormatE @ 1 NONAME - _ZN6QZXing11decodeImageE6QImage @ 2 NONAME - _ZN6QZXing11qt_metacallEN11QMetaObject4CallEiPPv @ 3 NONAME - _ZN6QZXing11qt_metacastEPKc @ 4 NONAME - _ZN6QZXing15decodingStartedEv @ 5 NONAME - _ZN6QZXing16decodingFinishedEb @ 6 NONAME - _ZN6QZXing16staticMetaObjectE @ 7 NONAME DATA 16 - _ZN6QZXing19getStaticMetaObjectEv @ 8 NONAME - _ZN6QZXing8tagFoundE7QString @ 9 NONAME - _ZN6QZXingC1EP7QObject @ 10 NONAME - _ZN6QZXingC2EP7QObject @ 11 NONAME - _ZNK6QZXing10metaObjectEv @ 12 NONAME - _ZTI18CameraImageWrapper @ 13 NONAME - _ZTI6QZXing @ 14 NONAME - _ZTIN5zxing11ResultPointE @ 15 NONAME - _ZTIN5zxing12BinaryBitmapE @ 16 NONAME - _ZTIN5zxing15FormatExceptionE @ 17 NONAME - _ZTIN5zxing15HybridBinarizerE @ 18 NONAME - _ZTIN5zxing15LuminanceSourceE @ 19 NONAME - _ZTIN5zxing15ReaderExceptionE @ 20 NONAME - _ZTIN5zxing17MultiFormatReaderE @ 21 NONAME - _ZTIN5zxing19ResultPointCallbackE @ 22 NONAME - _ZTIN5zxing20ReedSolomonExceptionE @ 23 NONAME - _ZTIN5zxing24GlobalHistogramBinarizerE @ 24 NONAME - _ZTIN5zxing24GreyscaleLuminanceSourceE @ 25 NONAME - _ZTIN5zxing24IllegalArgumentExceptionE @ 26 NONAME - _ZTIN5zxing31GreyscaleRotatedLuminanceSourceE @ 27 NONAME - _ZTIN5zxing4oned10EAN8ReaderE @ 28 NONAME - _ZTIN5zxing4oned10OneDReaderE @ 29 NONAME - _ZTIN5zxing4oned10UPCAReaderE @ 30 NONAME - _ZTIN5zxing4oned10UPCEReaderE @ 31 NONAME - _ZTIN5zxing4oned11EAN13ReaderE @ 32 NONAME - _ZTIN5zxing4oned12Code39ReaderE @ 33 NONAME - _ZTIN5zxing4oned12UPCEANReaderE @ 34 NONAME - _ZTIN5zxing4oned13Code128ReaderE @ 35 NONAME - _ZTIN5zxing4oned21MultiFormatOneDReaderE @ 36 NONAME - _ZTIN5zxing4oned23MultiFormatUPCEANReaderE @ 37 NONAME - _ZTIN5zxing4oned9ITFReaderE @ 38 NONAME - _ZTIN5zxing6ReaderE @ 39 NONAME - _ZTIN5zxing6ResultE @ 40 NONAME - _ZTIN5zxing6qrcode12QRCodeReaderE @ 41 NONAME - _ZTIN5zxing6qrcode14QREdgeDetectorE @ 42 NONAME - _ZTIN5zxing6qrcode22AlignmentPatternFinderE @ 43 NONAME - _ZTIN5zxing6qrcode7VersionE @ 44 NONAME - _ZTIN5zxing6qrcode8DataMaskE @ 45 NONAME - _ZTIN5zxing6qrcode8DetectorE @ 46 NONAME - _ZTIN5zxing8BitArrayE @ 47 NONAME - _ZTIN5zxing9BinarizerE @ 48 NONAME - _ZTIN5zxing9BitMatrixE @ 49 NONAME - _ZTIN5zxing9ExceptionE @ 50 NONAME - _ZTIN5zxing9GF256PolyE @ 51 NONAME - _ZTV18CameraImageWrapper @ 52 NONAME - _ZTV6QZXing @ 53 NONAME - _ZTVN5zxing11ResultPointE @ 54 NONAME - _ZTVN5zxing12BinaryBitmapE @ 55 NONAME - _ZTVN5zxing15FormatExceptionE @ 56 NONAME - _ZTVN5zxing15HybridBinarizerE @ 57 NONAME - _ZTVN5zxing15LuminanceSourceE @ 58 NONAME - _ZTVN5zxing15ReaderExceptionE @ 59 NONAME - _ZTVN5zxing17MultiFormatReaderE @ 60 NONAME - _ZTVN5zxing19ResultPointCallbackE @ 61 NONAME - _ZTVN5zxing20ReedSolomonExceptionE @ 62 NONAME - _ZTVN5zxing24GlobalHistogramBinarizerE @ 63 NONAME - _ZTVN5zxing24GreyscaleLuminanceSourceE @ 64 NONAME - _ZTVN5zxing24IllegalArgumentExceptionE @ 65 NONAME - _ZTVN5zxing31GreyscaleRotatedLuminanceSourceE @ 66 NONAME - _ZTVN5zxing4oned10EAN8ReaderE @ 67 NONAME - _ZTVN5zxing4oned10OneDReaderE @ 68 NONAME - _ZTVN5zxing4oned10UPCAReaderE @ 69 NONAME - _ZTVN5zxing4oned10UPCEReaderE @ 70 NONAME - _ZTVN5zxing4oned11EAN13ReaderE @ 71 NONAME - _ZTVN5zxing4oned12Code39ReaderE @ 72 NONAME - _ZTVN5zxing4oned12UPCEANReaderE @ 73 NONAME - _ZTVN5zxing4oned13Code128ReaderE @ 74 NONAME - _ZTVN5zxing4oned21MultiFormatOneDReaderE @ 75 NONAME - _ZTVN5zxing4oned23MultiFormatUPCEANReaderE @ 76 NONAME - _ZTVN5zxing4oned9ITFReaderE @ 77 NONAME - _ZTVN5zxing6ReaderE @ 78 NONAME - _ZTVN5zxing6ResultE @ 79 NONAME - _ZTVN5zxing6qrcode12QRCodeReaderE @ 80 NONAME - _ZTVN5zxing6qrcode14QREdgeDetectorE @ 81 NONAME - _ZTVN5zxing6qrcode22AlignmentPatternFinderE @ 82 NONAME - _ZTVN5zxing6qrcode7VersionE @ 83 NONAME - _ZTVN5zxing6qrcode8DataMaskE @ 84 NONAME - _ZTVN5zxing6qrcode8DetectorE @ 85 NONAME - _ZTVN5zxing8BitArrayE @ 86 NONAME - _ZTVN5zxing9BinarizerE @ 87 NONAME - _ZTVN5zxing9BitMatrixE @ 88 NONAME - _ZTVN5zxing9ExceptionE @ 89 NONAME - _ZTVN5zxing9GF256PolyE @ 90 NONAME - diff --git a/source/qzxing.cpp b/source/qzxing.cpp index c89243e..9a7e604 100644 --- a/source/qzxing.cpp +++ b/source/qzxing.cpp @@ -9,44 +9,52 @@ using namespace zxing; -QZXing::QZXing(QObject *parent) : QObject(parent) +QZXing::QZXing(QObject *parent) : QObject(parent), supportedFormats(511) { decoder = new MultiFormatReader(); - ((MultiFormatReader*)decoder)->setHints(DecodeHints::DEFAULT_HINT); +// setDecoder(DecoderFormat_QR_CODE | +// DecoderFormat_DATA_MATRIX | +// DecoderFormat_UPC_E | +// DecoderFormat_UPC_A | +// DecoderFormat_EAN_8 | +// DecoderFormat_EAN_13 | +// DecoderFormat_CODE_128 | +// DecoderFormat_CODE_39 | +// DecoderFormat_ITF); } -void QZXing::setDecoder(DecoderFormat hint) +void QZXing::setDecoder(DecoderFormatType hint) { - DecodeHints enabledDecoders; + DecodeHints newHints; if(hint & DecoderFormat_QR_CODE) - enabledDecoders.addFormat((BarcodeFormat)DecoderFormat_QR_CODE); + newHints.addFormat((BarcodeFormat)DecoderFormat_QR_CODE); if(hint & DecoderFormat_DATA_MATRIX) - enabledDecoders.addFormat((BarcodeFormat)DecoderFormat_DATA_MATRIX); + newHints.addFormat((BarcodeFormat)DecoderFormat_DATA_MATRIX); if(hint & DecoderFormat_UPC_E) - enabledDecoders.addFormat((BarcodeFormat)DecoderFormat_UPC_E); + newHints.addFormat((BarcodeFormat)DecoderFormat_UPC_E); if(hint & DecoderFormat_UPC_A) - enabledDecoders.addFormat((BarcodeFormat)DecoderFormat_UPC_A); + newHints.addFormat((BarcodeFormat)DecoderFormat_UPC_A); if(hint & DecoderFormat_EAN_8) - enabledDecoders.addFormat((BarcodeFormat)DecoderFormat_EAN_8); + newHints.addFormat((BarcodeFormat)DecoderFormat_EAN_8); if(hint & DecoderFormat_EAN_13) - enabledDecoders.addFormat((BarcodeFormat)DecoderFormat_EAN_13); + newHints.addFormat((BarcodeFormat)DecoderFormat_EAN_13); if(hint & DecoderFormat_CODE_128) - enabledDecoders.addFormat((BarcodeFormat)DecoderFormat_CODE_128); + newHints.addFormat((BarcodeFormat)DecoderFormat_CODE_128); if(hint & DecoderFormat_CODE_39) - enabledDecoders.addFormat((BarcodeFormat)DecoderFormat_CODE_39); + newHints.addFormat((BarcodeFormat)DecoderFormat_CODE_39); if(hint & DecoderFormat_ITF) - enabledDecoders.addFormat((BarcodeFormat)DecoderFormat_ITF); + newHints.addFormat((BarcodeFormat)DecoderFormat_ITF); - ((MultiFormatReader*)decoder)->setHints(enabledDecoders); + supportedFormats = newHints.getCurrentHint(); } QString QZXing::decodeImage(QImage image) @@ -63,7 +71,7 @@ QString QZXing::decodeImage(QImage image) Ref ref(bb); - res = ((MultiFormatReader*)decoder)->decode(ref); + res = ((MultiFormatReader*)decoder)->decode(ref, DecodeHints(supportedFormats)); QString string = QString(res->getText()->getText().c_str()); emit tagFound(string); diff --git a/source/zxing/DecodeHints.cpp b/source/zxing/DecodeHints.cpp index 578cdc5..a8ea4ec 100644 --- a/source/zxing/DecodeHints.cpp +++ b/source/zxing/DecodeHints.cpp @@ -109,4 +109,9 @@ Ref DecodeHints::getResultPointCallback() const { return callback; } +DecodeHintType DecodeHints::getCurrentHint() +{ + return hints; +} + } /* namespace */ diff --git a/source/zxing/DecodeHints.h b/source/zxing/DecodeHints.h index 7eb1201..0557dae 100644 --- a/source/zxing/DecodeHints.h +++ b/source/zxing/DecodeHints.h @@ -63,6 +63,7 @@ class DecodeHints { void setResultPointCallback(Ref const&); Ref getResultPointCallback() const; + DecodeHintType getCurrentHint(); }; } diff --git a/source/zxing/MultiFormatReader.cpp b/source/zxing/MultiFormatReader.cpp index 783c108..be181de 100644 --- a/source/zxing/MultiFormatReader.cpp +++ b/source/zxing/MultiFormatReader.cpp @@ -67,9 +67,9 @@ namespace zxing { if (hints.containsFormat(BarcodeFormat_QR_CODE)) { readers_.push_back(Ref(new zxing::qrcode::QRCodeReader())); } -// if (hints.containsFormat(BarcodeFormat_DATA_MATRIX)) { -// readers_.push_back(Ref(new zxing::datamatrix::DataMatrixReader())); -// } + if (hints.containsFormat(BarcodeFormat_DATA_MATRIX)) { + readers_.push_back(Ref(new zxing::datamatrix::DataMatrixReader())); + } //TODO: add PDF417 here once PDF417 reader is implemented if (addOneDReader && tryHarder) { readers_.push_back(Ref(new zxing::oned::MultiFormatOneDReader(hints))); diff --git a/source/zxing/common/detector/MonochromeRectangleDetector.h b/source/zxing/common/detector/MonochromeRectangleDetector.h index d8565e6..e749953 100644 --- a/source/zxing/common/detector/MonochromeRectangleDetector.h +++ b/source/zxing/common/detector/MonochromeRectangleDetector.h @@ -42,7 +42,7 @@ private: Ref image_; public: - MonochromeRectangleDetector(Ref image) : image_(image) { }; + MonochromeRectangleDetector(Ref image) : image_(image) { } std::vector > detect(); @@ -53,7 +53,7 @@ private: Ref blackWhiteRange(int fixedDimension, int maxWhiteRun, int minDim, int maxDim, bool horizontal); - int max(int a, float b) { return (float) a > b ? a : (int) b;}; + int max(int a, float b) { return (float) a > b ? a : (int) b;} }; } diff --git a/source/zxing/datamatrix/DataMatrixReader.cpp b/source/zxing/datamatrix/DataMatrixReader.cpp index 74a1b2c..56c00d4 100644 --- a/source/zxing/datamatrix/DataMatrixReader.cpp +++ b/source/zxing/datamatrix/DataMatrixReader.cpp @@ -19,7 +19,7 @@ */ #include -#include +#include #include namespace zxing { diff --git a/source/zxing/datamatrix/DataMatrixReader.h b/source/zxing/datamatrix/DataMatrixReader.h index e266739..3359a19 100644 --- a/source/zxing/datamatrix/DataMatrixReader.h +++ b/source/zxing/datamatrix/DataMatrixReader.h @@ -23,7 +23,7 @@ #include #include -#include +#include namespace zxing { namespace datamatrix { diff --git a/source/zxing/datamatrix/Version.cpp b/source/zxing/datamatrix/VersionDM.cpp similarity index 99% rename from source/zxing/datamatrix/Version.cpp rename to source/zxing/datamatrix/VersionDM.cpp index f94ca65..d7a69f3 100644 --- a/source/zxing/datamatrix/Version.cpp +++ b/source/zxing/datamatrix/VersionDM.cpp @@ -18,7 +18,7 @@ * limitations under the License. */ -#include +#include #include #include diff --git a/source/zxing/datamatrix/Version.h b/source/zxing/datamatrix/VersionDM.h similarity index 96% rename from source/zxing/datamatrix/Version.h rename to source/zxing/datamatrix/VersionDM.h index d8523fe..762d2a7 100644 --- a/source/zxing/datamatrix/Version.h +++ b/source/zxing/datamatrix/VersionDM.h @@ -1,5 +1,5 @@ -#ifndef __VERSION_H__ -#define __VERSION_H__ +#ifndef __VERSION_DM_H__ +#define __VERSION_DM_H__ /* * Version.h @@ -84,4 +84,4 @@ private: } } -#endif // __VERSION_H__ +#endif // __VERSION_DM_H__ diff --git a/source/zxing/datamatrix/decoder/BitMatrixParser.cpp b/source/zxing/datamatrix/decoder/BitMatrixParserDM.cpp similarity index 99% rename from source/zxing/datamatrix/decoder/BitMatrixParser.cpp rename to source/zxing/datamatrix/decoder/BitMatrixParserDM.cpp index 2e61da7..df307bb 100644 --- a/source/zxing/datamatrix/decoder/BitMatrixParser.cpp +++ b/source/zxing/datamatrix/decoder/BitMatrixParserDM.cpp @@ -18,7 +18,7 @@ * limitations under the License. */ -#include +#include #include #include diff --git a/source/zxing/datamatrix/decoder/BitMatrixParser.h b/source/zxing/datamatrix/decoder/BitMatrixParserDM.h similarity index 97% rename from source/zxing/datamatrix/decoder/BitMatrixParser.h rename to source/zxing/datamatrix/decoder/BitMatrixParserDM.h index 30123d5..c7cdd79 100644 --- a/source/zxing/datamatrix/decoder/BitMatrixParser.h +++ b/source/zxing/datamatrix/decoder/BitMatrixParserDM.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include namespace zxing { namespace datamatrix { diff --git a/source/zxing/datamatrix/decoder/DataBlock.cpp b/source/zxing/datamatrix/decoder/DataBlockDM.cpp similarity index 98% rename from source/zxing/datamatrix/decoder/DataBlock.cpp rename to source/zxing/datamatrix/decoder/DataBlockDM.cpp index c87d5f3..1f7e192 100644 --- a/source/zxing/datamatrix/decoder/DataBlock.cpp +++ b/source/zxing/datamatrix/decoder/DataBlockDM.cpp @@ -18,7 +18,7 @@ * limitations under the License. */ -#include +#include #include namespace zxing { diff --git a/source/zxing/datamatrix/decoder/DataBlock.h b/source/zxing/datamatrix/decoder/DataBlockDM.h similarity index 96% rename from source/zxing/datamatrix/decoder/DataBlock.h rename to source/zxing/datamatrix/decoder/DataBlockDM.h index 7fc72f6..44fc1fb 100644 --- a/source/zxing/datamatrix/decoder/DataBlock.h +++ b/source/zxing/datamatrix/decoder/DataBlockDM.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include namespace zxing { namespace datamatrix { diff --git a/source/zxing/datamatrix/decoder/DecodedBitStreamParser.cpp b/source/zxing/datamatrix/decoder/DecodedBitStreamParserDM.cpp similarity index 99% rename from source/zxing/datamatrix/decoder/DecodedBitStreamParser.cpp rename to source/zxing/datamatrix/decoder/DecodedBitStreamParserDM.cpp index 6df3a8b..47baaa3 100644 --- a/source/zxing/datamatrix/decoder/DecodedBitStreamParser.cpp +++ b/source/zxing/datamatrix/decoder/DecodedBitStreamParserDM.cpp @@ -19,7 +19,7 @@ */ #include -#include +#include #include #include diff --git a/source/zxing/datamatrix/decoder/DecodedBitStreamParser.h b/source/zxing/datamatrix/decoder/DecodedBitStreamParserDM.h similarity index 100% rename from source/zxing/datamatrix/decoder/DecodedBitStreamParser.h rename to source/zxing/datamatrix/decoder/DecodedBitStreamParserDM.h diff --git a/source/zxing/datamatrix/decoder/Decoder.cpp b/source/zxing/datamatrix/decoder/DecoderDM.cpp similarity index 92% rename from source/zxing/datamatrix/decoder/Decoder.cpp rename to source/zxing/datamatrix/decoder/DecoderDM.cpp index 6fc0421..1a442a9 100644 --- a/source/zxing/datamatrix/decoder/Decoder.cpp +++ b/source/zxing/datamatrix/decoder/DecoderDM.cpp @@ -18,11 +18,11 @@ * limitations under the License. */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include diff --git a/source/zxing/datamatrix/decoder/Decoder.h b/source/zxing/datamatrix/decoder/DecoderDM.h similarity index 100% rename from source/zxing/datamatrix/decoder/Decoder.h rename to source/zxing/datamatrix/decoder/DecoderDM.h diff --git a/source/zxing/datamatrix/detector/Detector.cpp b/source/zxing/datamatrix/detector/DetectorDM.cpp similarity index 99% rename from source/zxing/datamatrix/detector/Detector.cpp rename to source/zxing/datamatrix/detector/DetectorDM.cpp index 72d9ebf..e25c47a 100644 --- a/source/zxing/datamatrix/detector/Detector.cpp +++ b/source/zxing/datamatrix/detector/DetectorDM.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include #include diff --git a/source/zxing/datamatrix/detector/Detector.h b/source/zxing/datamatrix/detector/DetectorDM.h similarity index 97% rename from source/zxing/datamatrix/detector/Detector.h rename to source/zxing/datamatrix/detector/DetectorDM.h index 8e0bf06..c71bbac 100644 --- a/source/zxing/datamatrix/detector/Detector.h +++ b/source/zxing/datamatrix/detector/DetectorDM.h @@ -1,6 +1,6 @@ // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- -#ifndef __DETECTOR_H__ -#define __DETECTOR_H__ +#ifndef __DETECTOR_DM_H__ +#define __DETECTOR_DM_H__ /* * Detector.h @@ -91,4 +91,4 @@ class Detector: public Counted { } } -#endif // __DETECTOR_H__ +#endif // __DETECTOR_DM_H__ diff --git a/source/zxing/datamatrix/detector/DetectorException.h b/source/zxing/datamatrix/detector/DetectorException.h index 15174cc..efda0fe 100644 --- a/source/zxing/datamatrix/detector/DetectorException.h +++ b/source/zxing/datamatrix/detector/DetectorException.h @@ -5,8 +5,8 @@ * Author: luiz */ -#ifndef DETECTOREXCEPTION_H_ -#define DETECTOREXCEPTION_H_ +#ifndef DETECTOREXCEPTION_DM_H_ +#define DETECTOREXCEPTION_DM_H_ #include @@ -20,4 +20,4 @@ class DetectorException : public Exception { }; } /* namespace nexxera */ } /* namespace zxing */ -#endif /* DETECTOREXCEPTION_H_ */ +#endif /* DETECTOREXCEPTION_DM_H_ */ diff --git a/source/zxing/datamatrix/detector/MonochromeRectangleDetector.cpp b/source/zxing/datamatrix/detector/MonochromeRectangleDetectorDM.cpp similarity index 98% rename from source/zxing/datamatrix/detector/MonochromeRectangleDetector.cpp rename to source/zxing/datamatrix/detector/MonochromeRectangleDetectorDM.cpp index ffdf3ad..df8c1e4 100644 --- a/source/zxing/datamatrix/detector/MonochromeRectangleDetector.cpp +++ b/source/zxing/datamatrix/detector/MonochromeRectangleDetectorDM.cpp @@ -19,7 +19,7 @@ */ #include -#include +#include #include namespace zxing { diff --git a/source/zxing/datamatrix/detector/MonochromeRectangleDetector.h b/source/zxing/datamatrix/detector/MonochromeRectangleDetectorDM.h similarity index 99% rename from source/zxing/datamatrix/detector/MonochromeRectangleDetector.h rename to source/zxing/datamatrix/detector/MonochromeRectangleDetectorDM.h index 94556a6..ccf3af9 100644 --- a/source/zxing/datamatrix/detector/MonochromeRectangleDetector.h +++ b/source/zxing/datamatrix/detector/MonochromeRectangleDetectorDM.h @@ -42,7 +42,7 @@ private: Ref image_; public: - MonochromeRectangleDetector(Ref image) : image_(image) { }; + MonochromeRectangleDetector(Ref image) : image_(image) { } std::vector > detect(); @@ -53,7 +53,7 @@ private: Ref blackWhiteRange(int fixedDimension, int maxWhiteRun, int minDim, int maxDim, bool horizontal); - int max(int a, float b) { return (float) a > b ? a : (int) b;}; + int max(int a, float b) { return (float) a > b ? a : (int) b;} }; } } diff --git a/source/zxing/qrcode/decoder/DecodedBitStreamParser.cpp b/source/zxing/qrcode/decoder/DecodedBitStreamParser.cpp index 8d0d9e5..37e413a 100644 --- a/source/zxing/qrcode/decoder/DecodedBitStreamParser.cpp +++ b/source/zxing/qrcode/decoder/DecodedBitStreamParser.cpp @@ -82,7 +82,7 @@ void DecodedBitStreamParser::append(std::string &result, size_t nTo = maxOut; while (nFrom > 0) { - size_t oneway = iconv(cd, (char**)&fromPtr, &nFrom, &toPtr, &nTo); + size_t oneway = iconv(cd, (const char**)&fromPtr, &nFrom, &toPtr, &nTo); if (oneway == (size_t)(-1)) { iconv_close(cd); delete[] bufOut;