mirror of https://github.com/status-im/qzxing.git
Produced all the new binaries for Symbian^3, Windows Mingw, Windows MSCV, Harmattan. Still pending the binaries for Symbian^1.
This commit is contained in:
parent
8a6cf3add3
commit
11fec8100a
Binary file not shown.
|
@ -18,48 +18,71 @@
|
|||
*
|
||||
* Regarding DecoderFormat, by default all of those are enabled (except DataMatrix will is still not supported)
|
||||
*/
|
||||
class QZXINGSHARED_EXPORT QZXing : public QObject{
|
||||
class
|
||||
#ifndef DISABLE_LIBRARY_FEATURES
|
||||
QZXINGSHARED_EXPORT
|
||||
#endif
|
||||
QZXing : public QObject{
|
||||
|
||||
Q_OBJECT
|
||||
Q_ENUMS(DecoderFormat)
|
||||
Q_PROPERTY(int processingTime READ getProcessTimeOfLastDecoding)
|
||||
Q_PROPERTY(uint enabledDecoders READ getEnabledFormats WRITE setDecoder NOTIFY enabledFormatsChanged)
|
||||
|
||||
public:
|
||||
/*
|
||||
*
|
||||
*/
|
||||
enum DecoderFormat {
|
||||
DecoderFormat_None = 0,
|
||||
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,
|
||||
DecoderFormat_Aztec = 512
|
||||
DecoderFormat_Aztec = 1 << 1,
|
||||
DecoderFormat_CODABAR = 1 << 2,
|
||||
DecoderFormat_CODE_39 = 1 << 3,
|
||||
DecoderFormat_CODE_93 = 1 << 4,
|
||||
DecoderFormat_CODE_128 = 1 << 5,
|
||||
DecoderFormat_DATA_MATRIX = 1 << 6,
|
||||
DecoderFormat_EAN_8 = 1 << 7,
|
||||
DecoderFormat_EAN_13 = 1 << 8,
|
||||
DecoderFormat_ITF = 1 << 9,
|
||||
DecoderFormat_MAXICODE = 1 << 10,
|
||||
DecoderFormat_PDF_417 = 1 << 11,
|
||||
DecoderFormat_QR_CODE = 1 << 12,
|
||||
DecoderFormat_RSS_14 = 1 << 13,
|
||||
DecoderFormat_RSS_EXPANDED = 1 << 14,
|
||||
DecoderFormat_UPC_A = 1 << 15,
|
||||
DecoderFormat_UPC_E = 1 << 16,
|
||||
DecoderFormat_UPC_EAN_EXTENSION = 1 << 17
|
||||
} ;
|
||||
typedef unsigned int DecoderFormatType;
|
||||
|
||||
public:
|
||||
QZXing(QObject *parent = NULL);
|
||||
|
||||
/**
|
||||
* Set the enabled decoders.
|
||||
* 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(DecoderFormatType hint);
|
||||
QZXing(DecoderFormat decodeHints, QObject *parent = NULL);
|
||||
|
||||
#if QT_VERSION >= 0x040700
|
||||
static void registerQMLTypes()
|
||||
{
|
||||
qmlRegisterType<QZXing>("QZXing", 1, 2, "QZXing");
|
||||
qmlRegisterType<QZXing>("QZXing", 2, 2, "QZXing");
|
||||
}
|
||||
#endif
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* The decoding function. Will try to decode the given image based on the enabled decoders.
|
||||
* If the image width is larger than maxWidth or image height is larger
|
||||
* than maxHeight then the image will be scaled down. Either way, in case of scaling, the aspect
|
||||
* ratio of the image will be kept.
|
||||
*
|
||||
* The smoothTransformation flag determines whether the transformation will be smooth or fast.
|
||||
* Smooth transformation provides better results but fast transformation is...faster.
|
||||
*/
|
||||
QString decodeImage(QImage image);
|
||||
QString decodeImage(QImage image, int maxWidth=-1, int maxHeight=-1, bool smoothTransformation = false);
|
||||
|
||||
/**
|
||||
* The decoding function. Will try to decode the given image based on the enabled decoders.
|
||||
* The input image is read from a local image file.
|
||||
*/
|
||||
QString decodeImageFromFile(QString imageFilePath, int maxWidth=-1, int maxHeight=-1, bool smoothTransformation = false);
|
||||
|
||||
/**
|
||||
* The decoding function accessible from QML
|
||||
|
@ -74,15 +97,41 @@ public slots:
|
|||
const double offsetX = 0 , const double offsetY = 0,
|
||||
const double width = 0, const double height = 0);
|
||||
|
||||
/**
|
||||
* Get the prossecing time in millisecond of the last decode operation.
|
||||
* Added mainly as a statistic measure.
|
||||
* Decoding operation fails, the processing time equals to -1.
|
||||
*/
|
||||
int getProcessTimeOfLastDecoding();
|
||||
|
||||
/**
|
||||
* Get the decoders that are enabled at the moment.
|
||||
* Returns a uint which is a bitwise OR of DecoderFormat enumeration values.
|
||||
*/
|
||||
uint getEnabledFormats() const;
|
||||
/**
|
||||
* Set the enabled decoders.
|
||||
* 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(const uint& hint);
|
||||
|
||||
signals:
|
||||
void decodingStarted();
|
||||
void decodingFinished(bool succeeded);
|
||||
void tagFound(QString tag);
|
||||
void enabledFormatsChanged();
|
||||
|
||||
private:
|
||||
void* decoder;
|
||||
DecoderFormatType supportedFormats;
|
||||
DecoderFormatType enabledDecoders;
|
||||
QObject* imageHandler;
|
||||
int processingTime;
|
||||
|
||||
/**
|
||||
* If true, the decoding operation will take place at a different thread.
|
||||
*/
|
||||
bool isThreaded;
|
||||
};
|
||||
|
||||
#endif // QZXING_H
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,74 +0,0 @@
|
|||
#ifndef QZXING_H
|
||||
#define QZXING_H
|
||||
|
||||
#include "QZXing_global.h"
|
||||
#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.
|
||||
*
|
||||
* Anyone interested in using more technical stuff
|
||||
* from the ZXing library is welcomed to add/edit on free will.
|
||||
*
|
||||
* 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_ENUMS(DecoderFormat)
|
||||
public:
|
||||
enum DecoderFormat {
|
||||
DecoderFormat_None = 0,
|
||||
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);
|
||||
|
||||
/**
|
||||
* Set the enabled decoders.
|
||||
* 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(DecoderFormatType hint);
|
||||
|
||||
#if QT_VERSION >= 0x040700
|
||||
static void registerQMLTypes()
|
||||
{
|
||||
qmlRegisterType<QZXing>("QZXing", 1, 0, "QZXing");
|
||||
}
|
||||
#endif
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* The decoding function. Will try to decode the given image based on the enabled decoders.
|
||||
*
|
||||
*/
|
||||
QString decodeImage(QImage image);
|
||||
|
||||
signals:
|
||||
void decodingStarted();
|
||||
void decodingFinished(bool succeeded);
|
||||
void tagFound(QString tag);
|
||||
|
||||
private:
|
||||
void* decoder;
|
||||
DecoderFormatType supportedFormats;
|
||||
};
|
||||
|
||||
#endif // QZXING_H
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -18,48 +18,71 @@
|
|||
*
|
||||
* Regarding DecoderFormat, by default all of those are enabled (except DataMatrix will is still not supported)
|
||||
*/
|
||||
class QZXINGSHARED_EXPORT QZXing : public QObject{
|
||||
class
|
||||
#ifndef DISABLE_LIBRARY_FEATURES
|
||||
QZXINGSHARED_EXPORT
|
||||
#endif
|
||||
QZXing : public QObject{
|
||||
|
||||
Q_OBJECT
|
||||
Q_ENUMS(DecoderFormat)
|
||||
Q_PROPERTY(int processingTime READ getProcessTimeOfLastDecoding)
|
||||
Q_PROPERTY(uint enabledDecoders READ getEnabledFormats WRITE setDecoder NOTIFY enabledFormatsChanged)
|
||||
|
||||
public:
|
||||
/*
|
||||
*
|
||||
*/
|
||||
enum DecoderFormat {
|
||||
DecoderFormat_None = 0,
|
||||
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,
|
||||
DecoderFormat_Aztec = 512
|
||||
DecoderFormat_Aztec = 1 << 1,
|
||||
DecoderFormat_CODABAR = 1 << 2,
|
||||
DecoderFormat_CODE_39 = 1 << 3,
|
||||
DecoderFormat_CODE_93 = 1 << 4,
|
||||
DecoderFormat_CODE_128 = 1 << 5,
|
||||
DecoderFormat_DATA_MATRIX = 1 << 6,
|
||||
DecoderFormat_EAN_8 = 1 << 7,
|
||||
DecoderFormat_EAN_13 = 1 << 8,
|
||||
DecoderFormat_ITF = 1 << 9,
|
||||
DecoderFormat_MAXICODE = 1 << 10,
|
||||
DecoderFormat_PDF_417 = 1 << 11,
|
||||
DecoderFormat_QR_CODE = 1 << 12,
|
||||
DecoderFormat_RSS_14 = 1 << 13,
|
||||
DecoderFormat_RSS_EXPANDED = 1 << 14,
|
||||
DecoderFormat_UPC_A = 1 << 15,
|
||||
DecoderFormat_UPC_E = 1 << 16,
|
||||
DecoderFormat_UPC_EAN_EXTENSION = 1 << 17
|
||||
} ;
|
||||
typedef unsigned int DecoderFormatType;
|
||||
|
||||
public:
|
||||
QZXing(QObject *parent = NULL);
|
||||
|
||||
/**
|
||||
* Set the enabled decoders.
|
||||
* 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(DecoderFormatType hint);
|
||||
QZXing(DecoderFormat decodeHints, QObject *parent = NULL);
|
||||
|
||||
#if QT_VERSION >= 0x040700
|
||||
static void registerQMLTypes()
|
||||
{
|
||||
qmlRegisterType<QZXing>("QZXing", 1, 2, "QZXing");
|
||||
qmlRegisterType<QZXing>("QZXing", 2, 2, "QZXing");
|
||||
}
|
||||
#endif
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* The decoding function. Will try to decode the given image based on the enabled decoders.
|
||||
* If the image width is larger than maxWidth or image height is larger
|
||||
* than maxHeight then the image will be scaled down. Either way, in case of scaling, the aspect
|
||||
* ratio of the image will be kept.
|
||||
*
|
||||
* The smoothTransformation flag determines whether the transformation will be smooth or fast.
|
||||
* Smooth transformation provides better results but fast transformation is...faster.
|
||||
*/
|
||||
QString decodeImage(QImage image);
|
||||
QString decodeImage(QImage image, int maxWidth=-1, int maxHeight=-1, bool smoothTransformation = false);
|
||||
|
||||
/**
|
||||
* The decoding function. Will try to decode the given image based on the enabled decoders.
|
||||
* The input image is read from a local image file.
|
||||
*/
|
||||
QString decodeImageFromFile(QString imageFilePath, int maxWidth=-1, int maxHeight=-1, bool smoothTransformation = false);
|
||||
|
||||
/**
|
||||
* The decoding function accessible from QML
|
||||
|
@ -74,15 +97,41 @@ public slots:
|
|||
const double offsetX = 0 , const double offsetY = 0,
|
||||
const double width = 0, const double height = 0);
|
||||
|
||||
/**
|
||||
* Get the prossecing time in millisecond of the last decode operation.
|
||||
* Added mainly as a statistic measure.
|
||||
* Decoding operation fails, the processing time equals to -1.
|
||||
*/
|
||||
int getProcessTimeOfLastDecoding();
|
||||
|
||||
/**
|
||||
* Get the decoders that are enabled at the moment.
|
||||
* Returns a uint which is a bitwise OR of DecoderFormat enumeration values.
|
||||
*/
|
||||
uint getEnabledFormats() const;
|
||||
/**
|
||||
* Set the enabled decoders.
|
||||
* 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(const uint& hint);
|
||||
|
||||
signals:
|
||||
void decodingStarted();
|
||||
void decodingFinished(bool succeeded);
|
||||
void tagFound(QString tag);
|
||||
void enabledFormatsChanged();
|
||||
|
||||
private:
|
||||
void* decoder;
|
||||
DecoderFormatType supportedFormats;
|
||||
DecoderFormatType enabledDecoders;
|
||||
QObject* imageHandler;
|
||||
int processingTime;
|
||||
|
||||
/**
|
||||
* If true, the decoding operation will take place at a different thread.
|
||||
*/
|
||||
bool isThreaded;
|
||||
};
|
||||
|
||||
#endif // QZXING_H
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
#ifndef QZXING_GLOBAL_H
|
||||
#define QZXING_GLOBAL_H
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
#include <QtCore>
|
||||
#include <qglobal.h>
|
||||
|
||||
#if defined(QZXING_LIBRARY)
|
||||
# define QZXINGSHARED_EXPORT Q_DECL_EXPORT
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -18,48 +18,71 @@
|
|||
*
|
||||
* Regarding DecoderFormat, by default all of those are enabled (except DataMatrix will is still not supported)
|
||||
*/
|
||||
class QZXINGSHARED_EXPORT QZXing : public QObject{
|
||||
class
|
||||
#ifndef DISABLE_LIBRARY_FEATURES
|
||||
QZXINGSHARED_EXPORT
|
||||
#endif
|
||||
QZXing : public QObject{
|
||||
|
||||
Q_OBJECT
|
||||
Q_ENUMS(DecoderFormat)
|
||||
Q_PROPERTY(int processingTime READ getProcessTimeOfLastDecoding)
|
||||
Q_PROPERTY(uint enabledDecoders READ getEnabledFormats WRITE setDecoder NOTIFY enabledFormatsChanged)
|
||||
|
||||
public:
|
||||
/*
|
||||
*
|
||||
*/
|
||||
enum DecoderFormat {
|
||||
DecoderFormat_None = 0,
|
||||
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,
|
||||
DecoderFormat_Aztec = 512
|
||||
DecoderFormat_Aztec = 1 << 1,
|
||||
DecoderFormat_CODABAR = 1 << 2,
|
||||
DecoderFormat_CODE_39 = 1 << 3,
|
||||
DecoderFormat_CODE_93 = 1 << 4,
|
||||
DecoderFormat_CODE_128 = 1 << 5,
|
||||
DecoderFormat_DATA_MATRIX = 1 << 6,
|
||||
DecoderFormat_EAN_8 = 1 << 7,
|
||||
DecoderFormat_EAN_13 = 1 << 8,
|
||||
DecoderFormat_ITF = 1 << 9,
|
||||
DecoderFormat_MAXICODE = 1 << 10,
|
||||
DecoderFormat_PDF_417 = 1 << 11,
|
||||
DecoderFormat_QR_CODE = 1 << 12,
|
||||
DecoderFormat_RSS_14 = 1 << 13,
|
||||
DecoderFormat_RSS_EXPANDED = 1 << 14,
|
||||
DecoderFormat_UPC_A = 1 << 15,
|
||||
DecoderFormat_UPC_E = 1 << 16,
|
||||
DecoderFormat_UPC_EAN_EXTENSION = 1 << 17
|
||||
} ;
|
||||
typedef unsigned int DecoderFormatType;
|
||||
|
||||
public:
|
||||
QZXing(QObject *parent = NULL);
|
||||
|
||||
/**
|
||||
* Set the enabled decoders.
|
||||
* 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(DecoderFormatType hint);
|
||||
QZXing(DecoderFormat decodeHints, QObject *parent = NULL);
|
||||
|
||||
#if QT_VERSION >= 0x040700
|
||||
static void registerQMLTypes()
|
||||
{
|
||||
qmlRegisterType<QZXing>("QZXing", 1, 2, "QZXing");
|
||||
qmlRegisterType<QZXing>("QZXing", 2, 2, "QZXing");
|
||||
}
|
||||
#endif
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* The decoding function. Will try to decode the given image based on the enabled decoders.
|
||||
* If the image width is larger than maxWidth or image height is larger
|
||||
* than maxHeight then the image will be scaled down. Either way, in case of scaling, the aspect
|
||||
* ratio of the image will be kept.
|
||||
*
|
||||
* The smoothTransformation flag determines whether the transformation will be smooth or fast.
|
||||
* Smooth transformation provides better results but fast transformation is...faster.
|
||||
*/
|
||||
QString decodeImage(QImage image);
|
||||
QString decodeImage(QImage image, int maxWidth=-1, int maxHeight=-1, bool smoothTransformation = false);
|
||||
|
||||
/**
|
||||
* The decoding function. Will try to decode the given image based on the enabled decoders.
|
||||
* The input image is read from a local image file.
|
||||
*/
|
||||
QString decodeImageFromFile(QString imageFilePath, int maxWidth=-1, int maxHeight=-1, bool smoothTransformation = false);
|
||||
|
||||
/**
|
||||
* The decoding function accessible from QML
|
||||
|
@ -74,15 +97,41 @@ public slots:
|
|||
const double offsetX = 0 , const double offsetY = 0,
|
||||
const double width = 0, const double height = 0);
|
||||
|
||||
/**
|
||||
* Get the prossecing time in millisecond of the last decode operation.
|
||||
* Added mainly as a statistic measure.
|
||||
* Decoding operation fails, the processing time equals to -1.
|
||||
*/
|
||||
int getProcessTimeOfLastDecoding();
|
||||
|
||||
/**
|
||||
* Get the decoders that are enabled at the moment.
|
||||
* Returns a uint which is a bitwise OR of DecoderFormat enumeration values.
|
||||
*/
|
||||
uint getEnabledFormats() const;
|
||||
/**
|
||||
* Set the enabled decoders.
|
||||
* 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(const uint& hint);
|
||||
|
||||
signals:
|
||||
void decodingStarted();
|
||||
void decodingFinished(bool succeeded);
|
||||
void tagFound(QString tag);
|
||||
void enabledFormatsChanged();
|
||||
|
||||
private:
|
||||
void* decoder;
|
||||
DecoderFormatType supportedFormats;
|
||||
DecoderFormatType enabledDecoders;
|
||||
QObject* imageHandler;
|
||||
int processingTime;
|
||||
|
||||
/**
|
||||
* If true, the decoding operation will take place at a different thread.
|
||||
*/
|
||||
bool isThreaded;
|
||||
};
|
||||
|
||||
#endif // QZXING_H
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -1,7 +1,8 @@
|
|||
#ifndef QZXING_GLOBAL_H
|
||||
#define QZXING_GLOBAL_H
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
#include <QtCore>
|
||||
#include <qglobal.h>
|
||||
|
||||
#if defined(QZXING_LIBRARY)
|
||||
# define QZXINGSHARED_EXPORT Q_DECL_EXPORT
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,138 @@
|
|||
#ifndef QZXING_H
|
||||
#define QZXING_H
|
||||
|
||||
#include "QZXing_global.h"
|
||||
#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.
|
||||
*
|
||||
* Anyone interested in using more technical stuff
|
||||
* from the ZXing library is welcomed to add/edit on free will.
|
||||
*
|
||||
* Regarding DecoderFormat, by default all of those are enabled (except DataMatrix will is still not supported)
|
||||
*/
|
||||
class
|
||||
#ifndef DISABLE_LIBRARY_FEATURES
|
||||
QZXINGSHARED_EXPORT
|
||||
#endif
|
||||
QZXing : public QObject{
|
||||
|
||||
Q_OBJECT
|
||||
Q_ENUMS(DecoderFormat)
|
||||
Q_PROPERTY(int processingTime READ getProcessTimeOfLastDecoding)
|
||||
Q_PROPERTY(uint enabledDecoders READ getEnabledFormats WRITE setDecoder NOTIFY enabledFormatsChanged)
|
||||
|
||||
public:
|
||||
/*
|
||||
*
|
||||
*/
|
||||
enum DecoderFormat {
|
||||
DecoderFormat_None = 0,
|
||||
DecoderFormat_Aztec = 1 << 1,
|
||||
DecoderFormat_CODABAR = 1 << 2,
|
||||
DecoderFormat_CODE_39 = 1 << 3,
|
||||
DecoderFormat_CODE_93 = 1 << 4,
|
||||
DecoderFormat_CODE_128 = 1 << 5,
|
||||
DecoderFormat_DATA_MATRIX = 1 << 6,
|
||||
DecoderFormat_EAN_8 = 1 << 7,
|
||||
DecoderFormat_EAN_13 = 1 << 8,
|
||||
DecoderFormat_ITF = 1 << 9,
|
||||
DecoderFormat_MAXICODE = 1 << 10,
|
||||
DecoderFormat_PDF_417 = 1 << 11,
|
||||
DecoderFormat_QR_CODE = 1 << 12,
|
||||
DecoderFormat_RSS_14 = 1 << 13,
|
||||
DecoderFormat_RSS_EXPANDED = 1 << 14,
|
||||
DecoderFormat_UPC_A = 1 << 15,
|
||||
DecoderFormat_UPC_E = 1 << 16,
|
||||
DecoderFormat_UPC_EAN_EXTENSION = 1 << 17
|
||||
} ;
|
||||
typedef unsigned int DecoderFormatType;
|
||||
|
||||
QZXing(QObject *parent = NULL);
|
||||
|
||||
QZXing(DecoderFormat decodeHints, QObject *parent = NULL);
|
||||
|
||||
#if QT_VERSION >= 0x040700
|
||||
static void registerQMLTypes()
|
||||
{
|
||||
qmlRegisterType<QZXing>("QZXing", 2, 2, "QZXing");
|
||||
}
|
||||
#endif
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* The decoding function. Will try to decode the given image based on the enabled decoders.
|
||||
* If the image width is larger than maxWidth or image height is larger
|
||||
* than maxHeight then the image will be scaled down. Either way, in case of scaling, the aspect
|
||||
* ratio of the image will be kept.
|
||||
*
|
||||
* The smoothTransformation flag determines whether the transformation will be smooth or fast.
|
||||
* Smooth transformation provides better results but fast transformation is...faster.
|
||||
*/
|
||||
QString decodeImage(QImage image, int maxWidth=-1, int maxHeight=-1, bool smoothTransformation = false);
|
||||
|
||||
/**
|
||||
* The decoding function. Will try to decode the given image based on the enabled decoders.
|
||||
* The input image is read from a local image file.
|
||||
*/
|
||||
QString decodeImageFromFile(QString imageFilePath, int maxWidth=-1, int maxHeight=-1, bool smoothTransformation = false);
|
||||
|
||||
/**
|
||||
* The decoding function accessible from QML
|
||||
*/
|
||||
QString decodeImageQML(QObject *item);
|
||||
|
||||
/**
|
||||
* The decoding function accessible from QML. Able to set the decoding
|
||||
* of a portion of the image.
|
||||
*/
|
||||
QString decodeSubImageQML(QObject* item,
|
||||
const double offsetX = 0 , const double offsetY = 0,
|
||||
const double width = 0, const double height = 0);
|
||||
|
||||
/**
|
||||
* Get the prossecing time in millisecond of the last decode operation.
|
||||
* Added mainly as a statistic measure.
|
||||
* Decoding operation fails, the processing time equals to -1.
|
||||
*/
|
||||
int getProcessTimeOfLastDecoding();
|
||||
|
||||
/**
|
||||
* Get the decoders that are enabled at the moment.
|
||||
* Returns a uint which is a bitwise OR of DecoderFormat enumeration values.
|
||||
*/
|
||||
uint getEnabledFormats() const;
|
||||
/**
|
||||
* Set the enabled decoders.
|
||||
* 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(const uint& hint);
|
||||
|
||||
signals:
|
||||
void decodingStarted();
|
||||
void decodingFinished(bool succeeded);
|
||||
void tagFound(QString tag);
|
||||
void enabledFormatsChanged();
|
||||
|
||||
private:
|
||||
void* decoder;
|
||||
DecoderFormatType enabledDecoders;
|
||||
QObject* imageHandler;
|
||||
int processingTime;
|
||||
|
||||
/**
|
||||
* If true, the decoding operation will take place at a different thread.
|
||||
*/
|
||||
bool isThreaded;
|
||||
};
|
||||
|
||||
#endif // QZXING_H
|
||||
|
Binary file not shown.
Binary file not shown.
|
@ -1,7 +1,8 @@
|
|||
#ifndef QZXING_GLOBAL_H
|
||||
#define QZXING_GLOBAL_H
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
#include <QtCore>
|
||||
#include <qglobal.h>
|
||||
|
||||
#if defined(QZXING_LIBRARY)
|
||||
# define QZXINGSHARED_EXPORT Q_DECL_EXPORT
|
|
@ -250,7 +250,7 @@ unix:!symbian {
|
|||
}
|
||||
|
||||
DEFINES += NOFMAXL
|
||||
INSTALLS += target
|
||||
INSTALLS q+= target
|
||||
}
|
||||
|
||||
win32-msvc*{
|
||||
|
|
|
@ -0,0 +1,128 @@
|
|||
EXPORTS
|
||||
_ZN6QZXing10setDecoderERKj @ 1 NONAME
|
||||
_ZN6QZXing11decodeImageE6QImageiib @ 2 NONAME
|
||||
_ZN6QZXing11qt_metacallEN11QMetaObject4CallEiPPv @ 3 NONAME
|
||||
_ZN6QZXing11qt_metacastEPKc @ 4 NONAME
|
||||
_ZN6QZXing14decodeImageQMLEP7QObject @ 5 NONAME
|
||||
_ZN6QZXing15decodingStartedEv @ 6 NONAME
|
||||
_ZN6QZXing16decodingFinishedEb @ 7 NONAME
|
||||
_ZN6QZXing16staticMetaObjectE @ 8 NONAME DATA 16
|
||||
_ZN6QZXing17decodeSubImageQMLEP7QObjectdddd @ 9 NONAME
|
||||
_ZN6QZXing19decodeImageFromFileE7QStringiib @ 10 NONAME
|
||||
_ZN6QZXing19getStaticMetaObjectEv @ 11 NONAME
|
||||
_ZN6QZXing21enabledFormatsChangedEv @ 12 NONAME
|
||||
_ZN6QZXing28getProcessTimeOfLastDecodingEv @ 13 NONAME
|
||||
_ZN6QZXing8tagFoundE7QString @ 14 NONAME
|
||||
_ZN6QZXingC1ENS_13DecoderFormatEP7QObject @ 15 NONAME
|
||||
_ZN6QZXingC1EP7QObject @ 16 NONAME
|
||||
_ZN6QZXingC2ENS_13DecoderFormatEP7QObject @ 17 NONAME
|
||||
_ZN6QZXingC2EP7QObject @ 18 NONAME
|
||||
_ZNK6QZXing10metaObjectEv @ 19 NONAME
|
||||
_ZNK6QZXing17getEnabledFormatsEv @ 20 NONAME
|
||||
_ZTI12ImageHandler @ 21 NONAME
|
||||
_ZTI18CameraImageWrapper @ 22 NONAME
|
||||
_ZTI6QZXing @ 23 NONAME
|
||||
_ZTIN5zxing10datamatrix16DataMatrixReaderE @ 24 NONAME
|
||||
_ZTIN5zxing10datamatrix17DetectorExceptionE @ 25 NONAME
|
||||
_ZTIN5zxing10datamatrix7VersionE @ 26 NONAME
|
||||
_ZTIN5zxing10datamatrix8DetectorE @ 27 NONAME
|
||||
_ZTIN5zxing11ResultPointE @ 28 NONAME
|
||||
_ZTIN5zxing12BinaryBitmapE @ 29 NONAME
|
||||
_ZTIN5zxing15FormatExceptionE @ 30 NONAME
|
||||
_ZTIN5zxing15HybridBinarizerE @ 31 NONAME
|
||||
_ZTIN5zxing15LuminanceSourceE @ 32 NONAME
|
||||
_ZTIN5zxing17ChecksumExceptionE @ 33 NONAME
|
||||
_ZTIN5zxing17MultiFormatReaderE @ 34 NONAME
|
||||
_ZTIN5zxing19ResultPointCallbackE @ 35 NONAME
|
||||
_ZTIN5zxing20ReedSolomonExceptionE @ 36 NONAME
|
||||
_ZTIN5zxing23InvertedLuminanceSourceE @ 37 NONAME
|
||||
_ZTIN5zxing24GlobalHistogramBinarizerE @ 38 NONAME
|
||||
_ZTIN5zxing24GreyscaleLuminanceSourceE @ 39 NONAME
|
||||
_ZTIN5zxing24IllegalArgumentExceptionE @ 40 NONAME
|
||||
_ZTIN5zxing31GreyscaleRotatedLuminanceSourceE @ 41 NONAME
|
||||
_ZTIN5zxing4oned10EAN8ReaderE @ 42 NONAME
|
||||
_ZTIN5zxing4oned10OneDReaderE @ 43 NONAME
|
||||
_ZTIN5zxing4oned10UPCAReaderE @ 44 NONAME
|
||||
_ZTIN5zxing4oned10UPCEReaderE @ 45 NONAME
|
||||
_ZTIN5zxing4oned11EAN13ReaderE @ 46 NONAME
|
||||
_ZTIN5zxing4oned12Code39ReaderE @ 47 NONAME
|
||||
_ZTIN5zxing4oned12Code93ReaderE @ 48 NONAME
|
||||
_ZTIN5zxing4oned12UPCEANReaderE @ 49 NONAME
|
||||
_ZTIN5zxing4oned13CodaBarReaderE @ 50 NONAME
|
||||
_ZTIN5zxing4oned13Code128ReaderE @ 51 NONAME
|
||||
_ZTIN5zxing4oned21MultiFormatOneDReaderE @ 52 NONAME
|
||||
_ZTIN5zxing4oned23MultiFormatUPCEANReaderE @ 53 NONAME
|
||||
_ZTIN5zxing4oned9ITFReaderE @ 54 NONAME
|
||||
_ZTIN5zxing5aztec11AztecReaderE @ 55 NONAME
|
||||
_ZTIN5zxing5multi13MultiDetectorE @ 56 NONAME
|
||||
_ZTIN5zxing5multi16ByQuadrantReaderE @ 57 NONAME
|
||||
_ZTIN5zxing5multi17QRCodeMultiReaderE @ 58 NONAME
|
||||
_ZTIN5zxing5multi21MultipleBarcodeReaderE @ 59 NONAME
|
||||
_ZTIN5zxing5multi24MultiFinderPatternFinderE @ 60 NONAME
|
||||
_ZTIN5zxing5multi28GenericMultipleBarcodeReaderE @ 61 NONAME
|
||||
_ZTIN5zxing6ReaderE @ 62 NONAME
|
||||
_ZTIN5zxing6ResultE @ 63 NONAME
|
||||
_ZTIN5zxing6pdf41712PDF417ReaderE @ 64 NONAME
|
||||
_ZTIN5zxing6pdf4177decoder2ec11ModulusPolyE @ 65 NONAME
|
||||
_ZTIN5zxing6qrcode12QRCodeReaderE @ 66 NONAME
|
||||
_ZTIN5zxing6qrcode22AlignmentPatternFinderE @ 67 NONAME
|
||||
_ZTIN5zxing6qrcode7VersionE @ 68 NONAME
|
||||
_ZTIN5zxing6qrcode8DataMaskE @ 69 NONAME
|
||||
_ZTIN5zxing6qrcode8DetectorE @ 70 NONAME
|
||||
_ZTIN5zxing8BitArrayE @ 71 NONAME
|
||||
_ZTIN5zxing9BinarizerE @ 72 NONAME
|
||||
_ZTIN5zxing9BitMatrixE @ 73 NONAME
|
||||
_ZTV12ImageHandler @ 74 NONAME
|
||||
_ZTV18CameraImageWrapper @ 75 NONAME
|
||||
_ZTV6QZXing @ 76 NONAME
|
||||
_ZTVN5zxing10datamatrix16DataMatrixReaderE @ 77 NONAME
|
||||
_ZTVN5zxing10datamatrix17DetectorExceptionE @ 78 NONAME
|
||||
_ZTVN5zxing10datamatrix7VersionE @ 79 NONAME
|
||||
_ZTVN5zxing10datamatrix8DetectorE @ 80 NONAME
|
||||
_ZTVN5zxing11ResultPointE @ 81 NONAME
|
||||
_ZTVN5zxing12BinaryBitmapE @ 82 NONAME
|
||||
_ZTVN5zxing15FormatExceptionE @ 83 NONAME
|
||||
_ZTVN5zxing15HybridBinarizerE @ 84 NONAME
|
||||
_ZTVN5zxing15LuminanceSourceE @ 85 NONAME
|
||||
_ZTVN5zxing17ChecksumExceptionE @ 86 NONAME
|
||||
_ZTVN5zxing17MultiFormatReaderE @ 87 NONAME
|
||||
_ZTVN5zxing19ResultPointCallbackE @ 88 NONAME
|
||||
_ZTVN5zxing20ReedSolomonExceptionE @ 89 NONAME
|
||||
_ZTVN5zxing23InvertedLuminanceSourceE @ 90 NONAME
|
||||
_ZTVN5zxing24GlobalHistogramBinarizerE @ 91 NONAME
|
||||
_ZTVN5zxing24GreyscaleLuminanceSourceE @ 92 NONAME
|
||||
_ZTVN5zxing24IllegalArgumentExceptionE @ 93 NONAME
|
||||
_ZTVN5zxing31GreyscaleRotatedLuminanceSourceE @ 94 NONAME
|
||||
_ZTVN5zxing4oned10EAN8ReaderE @ 95 NONAME
|
||||
_ZTVN5zxing4oned10OneDReaderE @ 96 NONAME
|
||||
_ZTVN5zxing4oned10UPCAReaderE @ 97 NONAME
|
||||
_ZTVN5zxing4oned10UPCEReaderE @ 98 NONAME
|
||||
_ZTVN5zxing4oned11EAN13ReaderE @ 99 NONAME
|
||||
_ZTVN5zxing4oned12Code39ReaderE @ 100 NONAME
|
||||
_ZTVN5zxing4oned12Code93ReaderE @ 101 NONAME
|
||||
_ZTVN5zxing4oned12UPCEANReaderE @ 102 NONAME
|
||||
_ZTVN5zxing4oned13CodaBarReaderE @ 103 NONAME
|
||||
_ZTVN5zxing4oned13Code128ReaderE @ 104 NONAME
|
||||
_ZTVN5zxing4oned21MultiFormatOneDReaderE @ 105 NONAME
|
||||
_ZTVN5zxing4oned23MultiFormatUPCEANReaderE @ 106 NONAME
|
||||
_ZTVN5zxing4oned9ITFReaderE @ 107 NONAME
|
||||
_ZTVN5zxing5aztec11AztecReaderE @ 108 NONAME
|
||||
_ZTVN5zxing5multi13MultiDetectorE @ 109 NONAME
|
||||
_ZTVN5zxing5multi16ByQuadrantReaderE @ 110 NONAME
|
||||
_ZTVN5zxing5multi17QRCodeMultiReaderE @ 111 NONAME
|
||||
_ZTVN5zxing5multi21MultipleBarcodeReaderE @ 112 NONAME
|
||||
_ZTVN5zxing5multi24MultiFinderPatternFinderE @ 113 NONAME
|
||||
_ZTVN5zxing5multi28GenericMultipleBarcodeReaderE @ 114 NONAME
|
||||
_ZTVN5zxing6ReaderE @ 115 NONAME
|
||||
_ZTVN5zxing6ResultE @ 116 NONAME
|
||||
_ZTVN5zxing6pdf41712PDF417ReaderE @ 117 NONAME
|
||||
_ZTVN5zxing6pdf4177decoder2ec11ModulusPolyE @ 118 NONAME
|
||||
_ZTVN5zxing6qrcode12QRCodeReaderE @ 119 NONAME
|
||||
_ZTVN5zxing6qrcode22AlignmentPatternFinderE @ 120 NONAME
|
||||
_ZTVN5zxing6qrcode7VersionE @ 121 NONAME
|
||||
_ZTVN5zxing6qrcode8DataMaskE @ 122 NONAME
|
||||
_ZTVN5zxing6qrcode8DetectorE @ 123 NONAME
|
||||
_ZTVN5zxing8BitArrayE @ 124 NONAME
|
||||
_ZTVN5zxing9BinarizerE @ 125 NONAME
|
||||
_ZTVN5zxing9BitMatrixE @ 126 NONAME
|
||||
|
Loading…
Reference in New Issue