Moved to version 1.1, Datamatrix is supported, selection of the enabled decoders fixed, binaries updated

This commit is contained in:
favoritas37 2011-11-29 16:38:16 +02:00
parent 0942470215
commit 99bf5fc5e8
29 changed files with 178 additions and 59 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -5,6 +5,10 @@
#include <QObject>
#include <QImage>
#if QT_VERSION >= 0x040700
#include <QtDeclarative>
#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>("QZXing", 1, 0, "QZXing");
}
#endif
public slots:
/**
@ -54,6 +67,7 @@ signals:
private:
void* decoder;
DecoderFormatType supportedFormats;
};
#endif // QZXING_H

View File

@ -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

View File

@ -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

View File

@ -41,7 +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 );
decoder.setDecoder( QZXing::DecoderFormat_DATA_MATRIX);//DecoderFormat_QR_CODE | DecoderFormat_EAN_13 );
}
QQrDecoder::~QQrDecoder()

View File

@ -1,7 +1,8 @@
TEMPLATE = app
TARGET = QQrDecoder
QT += core \
gui
gui \
declarative
VERSION = 1.2.1

View File

@ -1,5 +1,5 @@
// ============================================================================
// * Generated by qmake (2.01a) (Qt 4.7.3) on: 2011-11-26T14:57:01
// * Generated by qmake (2.01a) (Qt 4.7.3) on: 2011-11-29T12:15:30
// * This file is generated by qmake and should not be modified by the
// * user.
// ============================================================================

Binary file not shown.

View File

@ -1,5 +1,5 @@
// ============================================================================
// * Generated by qmake (2.01a) (Qt 4.7.3) on: 2011-11-26T14:57:01
// * Generated by qmake (2.01a) (Qt 4.7.3) on: 2011-11-29T12:15:30
// * This file is generated by qmake and should not be modified by the
// * user.
// ============================================================================

View File

@ -6,10 +6,9 @@
QT += core gui
VERSION = 1.0
VERSION = 1.1
lessThan(QT_VERSION, 4.7):
else:QT += declarative
greaterThan(QT_VERSION, 4.7): QT += declarative
TARGET = QZXing
TEMPLATE = lib
@ -185,7 +184,6 @@ SOURCES += zxing/BarcodeFormat.cpp \
qzxing.cpp
symbian {
#MMP_RULES += EXPORTUNFROZEN
TARGET.UID3 = 0xE618743C
TARGET.EPOCALLOWDLLDATA = 1
addFiles.sources = QZXing.dll

Binary file not shown.

102
source/eabi/QZXingu.def Normal file
View File

@ -0,0 +1,102 @@
EXPORTS
_ZN6QZXing10setDecoderEj @ 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
_ZTIN5zxing10datamatrix16DataMatrixReaderE @ 15 NONAME
_ZTIN5zxing10datamatrix17DetectorExceptionE @ 16 NONAME
_ZTIN5zxing10datamatrix7VersionE @ 17 NONAME
_ZTIN5zxing10datamatrix8DetectorE @ 18 NONAME
_ZTIN5zxing11ResultPointE @ 19 NONAME
_ZTIN5zxing12BinaryBitmapE @ 20 NONAME
_ZTIN5zxing15FormatExceptionE @ 21 NONAME
_ZTIN5zxing15HybridBinarizerE @ 22 NONAME
_ZTIN5zxing15LuminanceSourceE @ 23 NONAME
_ZTIN5zxing15ReaderExceptionE @ 24 NONAME
_ZTIN5zxing17MultiFormatReaderE @ 25 NONAME
_ZTIN5zxing17NotFoundExceptionE @ 26 NONAME
_ZTIN5zxing19ResultPointCallbackE @ 27 NONAME
_ZTIN5zxing20ReedSolomonExceptionE @ 28 NONAME
_ZTIN5zxing24GlobalHistogramBinarizerE @ 29 NONAME
_ZTIN5zxing24GreyscaleLuminanceSourceE @ 30 NONAME
_ZTIN5zxing24IllegalArgumentExceptionE @ 31 NONAME
_ZTIN5zxing31GreyscaleRotatedLuminanceSourceE @ 32 NONAME
_ZTIN5zxing4oned10EAN8ReaderE @ 33 NONAME
_ZTIN5zxing4oned10OneDReaderE @ 34 NONAME
_ZTIN5zxing4oned10UPCAReaderE @ 35 NONAME
_ZTIN5zxing4oned10UPCEReaderE @ 36 NONAME
_ZTIN5zxing4oned11EAN13ReaderE @ 37 NONAME
_ZTIN5zxing4oned12Code39ReaderE @ 38 NONAME
_ZTIN5zxing4oned12UPCEANReaderE @ 39 NONAME
_ZTIN5zxing4oned13Code128ReaderE @ 40 NONAME
_ZTIN5zxing4oned21MultiFormatOneDReaderE @ 41 NONAME
_ZTIN5zxing4oned23MultiFormatUPCEANReaderE @ 42 NONAME
_ZTIN5zxing4oned9ITFReaderE @ 43 NONAME
_ZTIN5zxing6ReaderE @ 44 NONAME
_ZTIN5zxing6ResultE @ 45 NONAME
_ZTIN5zxing6qrcode12QRCodeReaderE @ 46 NONAME
_ZTIN5zxing6qrcode14QREdgeDetectorE @ 47 NONAME
_ZTIN5zxing6qrcode22AlignmentPatternFinderE @ 48 NONAME
_ZTIN5zxing6qrcode7VersionE @ 49 NONAME
_ZTIN5zxing6qrcode8DataMaskE @ 50 NONAME
_ZTIN5zxing6qrcode8DetectorE @ 51 NONAME
_ZTIN5zxing8BitArrayE @ 52 NONAME
_ZTIN5zxing9BinarizerE @ 53 NONAME
_ZTIN5zxing9BitMatrixE @ 54 NONAME
_ZTIN5zxing9ExceptionE @ 55 NONAME
_ZTIN5zxing9GF256PolyE @ 56 NONAME
_ZTV18CameraImageWrapper @ 57 NONAME
_ZTV6QZXing @ 58 NONAME
_ZTVN5zxing10datamatrix16DataMatrixReaderE @ 59 NONAME
_ZTVN5zxing10datamatrix17DetectorExceptionE @ 60 NONAME
_ZTVN5zxing10datamatrix7VersionE @ 61 NONAME
_ZTVN5zxing10datamatrix8DetectorE @ 62 NONAME
_ZTVN5zxing11ResultPointE @ 63 NONAME
_ZTVN5zxing12BinaryBitmapE @ 64 NONAME
_ZTVN5zxing15FormatExceptionE @ 65 NONAME
_ZTVN5zxing15HybridBinarizerE @ 66 NONAME
_ZTVN5zxing15LuminanceSourceE @ 67 NONAME
_ZTVN5zxing15ReaderExceptionE @ 68 NONAME
_ZTVN5zxing17MultiFormatReaderE @ 69 NONAME
_ZTVN5zxing17NotFoundExceptionE @ 70 NONAME
_ZTVN5zxing19ResultPointCallbackE @ 71 NONAME
_ZTVN5zxing20ReedSolomonExceptionE @ 72 NONAME
_ZTVN5zxing24GlobalHistogramBinarizerE @ 73 NONAME
_ZTVN5zxing24GreyscaleLuminanceSourceE @ 74 NONAME
_ZTVN5zxing24IllegalArgumentExceptionE @ 75 NONAME
_ZTVN5zxing31GreyscaleRotatedLuminanceSourceE @ 76 NONAME
_ZTVN5zxing4oned10EAN8ReaderE @ 77 NONAME
_ZTVN5zxing4oned10OneDReaderE @ 78 NONAME
_ZTVN5zxing4oned10UPCAReaderE @ 79 NONAME
_ZTVN5zxing4oned10UPCEReaderE @ 80 NONAME
_ZTVN5zxing4oned11EAN13ReaderE @ 81 NONAME
_ZTVN5zxing4oned12Code39ReaderE @ 82 NONAME
_ZTVN5zxing4oned12UPCEANReaderE @ 83 NONAME
_ZTVN5zxing4oned13Code128ReaderE @ 84 NONAME
_ZTVN5zxing4oned21MultiFormatOneDReaderE @ 85 NONAME
_ZTVN5zxing4oned23MultiFormatUPCEANReaderE @ 86 NONAME
_ZTVN5zxing4oned9ITFReaderE @ 87 NONAME
_ZTVN5zxing6ReaderE @ 88 NONAME
_ZTVN5zxing6ResultE @ 89 NONAME
_ZTVN5zxing6qrcode12QRCodeReaderE @ 90 NONAME
_ZTVN5zxing6qrcode14QREdgeDetectorE @ 91 NONAME
_ZTVN5zxing6qrcode22AlignmentPatternFinderE @ 92 NONAME
_ZTVN5zxing6qrcode7VersionE @ 93 NONAME
_ZTVN5zxing6qrcode8DataMaskE @ 94 NONAME
_ZTVN5zxing6qrcode8DetectorE @ 95 NONAME
_ZTVN5zxing8BitArrayE @ 96 NONAME
_ZTVN5zxing9BinarizerE @ 97 NONAME
_ZTVN5zxing9BitMatrixE @ 98 NONAME
_ZTVN5zxing9ExceptionE @ 99 NONAME
_ZTVN5zxing9GF256PolyE @ 100 NONAME

View File

@ -9,18 +9,18 @@
using namespace zxing;
QZXing::QZXing(QObject *parent) : QObject(parent), supportedFormats(511)
QZXing::QZXing(QObject *parent) : QObject(parent)
{
decoder = new MultiFormatReader();
// 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);
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(DecoderFormatType hint)
@ -28,31 +28,31 @@ void QZXing::setDecoder(DecoderFormatType hint)
DecodeHints newHints;
if(hint & DecoderFormat_QR_CODE)
newHints.addFormat((BarcodeFormat)DecoderFormat_QR_CODE);
newHints.addFormat((BarcodeFormat)BarcodeFormat_QR_CODE);
if(hint & DecoderFormat_DATA_MATRIX)
newHints.addFormat((BarcodeFormat)DecoderFormat_DATA_MATRIX);
newHints.addFormat((BarcodeFormat)BarcodeFormat_DATA_MATRIX);
if(hint & DecoderFormat_UPC_E)
newHints.addFormat((BarcodeFormat)DecoderFormat_UPC_E);
newHints.addFormat((BarcodeFormat)BarcodeFormat_UPC_E);
if(hint & DecoderFormat_UPC_A)
newHints.addFormat((BarcodeFormat)DecoderFormat_UPC_A);
newHints.addFormat((BarcodeFormat)BarcodeFormat_UPC_A);
if(hint & DecoderFormat_EAN_8)
newHints.addFormat((BarcodeFormat)DecoderFormat_EAN_8);
newHints.addFormat((BarcodeFormat)BarcodeFormat_EAN_8);
if(hint & DecoderFormat_EAN_13)
newHints.addFormat((BarcodeFormat)DecoderFormat_EAN_13);
newHints.addFormat((BarcodeFormat)BarcodeFormat_EAN_13);
if(hint & DecoderFormat_CODE_128)
newHints.addFormat((BarcodeFormat)DecoderFormat_CODE_128);
newHints.addFormat((BarcodeFormat)BarcodeFormat_CODE_128);
if(hint & DecoderFormat_CODE_39)
newHints.addFormat((BarcodeFormat)DecoderFormat_CODE_39);
newHints.addFormat((BarcodeFormat)BarcodeFormat_CODE_39);
if(hint & DecoderFormat_ITF)
newHints.addFormat((BarcodeFormat)DecoderFormat_ITF);
newHints.addFormat((BarcodeFormat)BarcodeFormat_ITF);
supportedFormats = newHints.getCurrentHint();
}
@ -71,7 +71,7 @@ QString QZXing::decodeImage(QImage image)
Ref<BinaryBitmap> ref(bb);
res = ((MultiFormatReader*)decoder)->decode(ref, DecodeHints(supportedFormats));
res = ((MultiFormatReader*)decoder)->decode(ref, DecodeHints((int)supportedFormats));
QString string = QString(res->getText()->getText().c_str());
emit tagFound(string);