mirror of https://github.com/status-im/qzxing.git
Still in the proccess of updating the project.
This commit is contained in:
parent
df31c84c06
commit
a1baf435b4
|
@ -22,19 +22,30 @@ 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,
|
||||
DecoderFormat_Aztec = 512
|
||||
} ;
|
||||
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;
|
||||
|
||||
public:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include "qzxing.h"
|
||||
|
||||
#include <zxing/common/GlobalHistogramBinarizer.h>
|
||||
#include <zxing/Binarizer.h>
|
||||
//#include <zxing/Binarizer.h>
|
||||
#include <zxing/BinaryBitmap.h>
|
||||
#include <zxing/MultiFormatReader.h>
|
||||
#include <zxing/DecodeHints.h>
|
||||
|
@ -28,39 +28,60 @@ QZXing::QZXing(QObject *parent) : QObject(parent)
|
|||
|
||||
void QZXing::setDecoder(DecoderFormatType hint)
|
||||
{
|
||||
DecodeHints newHints;
|
||||
|
||||
if(hint & DecoderFormat_QR_CODE)
|
||||
newHints.addFormat((BarcodeFormat)BarcodeFormat_QR_CODE);
|
||||
|
||||
if(hint & DecoderFormat_DATA_MATRIX)
|
||||
newHints.addFormat((BarcodeFormat)BarcodeFormat_DATA_MATRIX);
|
||||
|
||||
if(hint & DecoderFormat_UPC_E)
|
||||
newHints.addFormat((BarcodeFormat)BarcodeFormat_UPC_E);
|
||||
|
||||
if(hint & DecoderFormat_UPC_A)
|
||||
newHints.addFormat((BarcodeFormat)BarcodeFormat_UPC_A);
|
||||
|
||||
if(hint & DecoderFormat_EAN_8)
|
||||
newHints.addFormat((BarcodeFormat)BarcodeFormat_EAN_8);
|
||||
|
||||
if(hint & DecoderFormat_EAN_13)
|
||||
newHints.addFormat((BarcodeFormat)BarcodeFormat_EAN_13);
|
||||
|
||||
if(hint & DecoderFormat_CODE_128)
|
||||
newHints.addFormat((BarcodeFormat)BarcodeFormat_CODE_128);
|
||||
|
||||
if(hint & DecoderFormat_CODE_39)
|
||||
newHints.addFormat((BarcodeFormat)BarcodeFormat_CODE_39);
|
||||
|
||||
if(hint & DecoderFormat_ITF)
|
||||
newHints.addFormat((BarcodeFormat)BarcodeFormat_ITF);
|
||||
unsigned int newHints = 0;
|
||||
|
||||
if(hint & DecoderFormat_Aztec)
|
||||
newHints.addFormat((BarcodeFormat)BarcodeFormat_AZTEC);
|
||||
newHints |= BarcodeFormat::AZTEC;
|
||||
|
||||
supportedFormats = newHints.getCurrentHint();
|
||||
if(hint & DecoderFormat_CODABAR)
|
||||
newHints |= BarcodeFormat::CODABAR;
|
||||
|
||||
if(hint & DecoderFormat_CODE_39)
|
||||
newHints |= BarcodeFormat::CODE_39;
|
||||
|
||||
if(hint & DecoderFormat_CODE_93)
|
||||
newHints |= BarcodeFormat::CODE_93;
|
||||
|
||||
if(hint & DecoderFormat_CODE_128)
|
||||
newHints |= BarcodeFormat::CODE_128;
|
||||
|
||||
if(hint & DecoderFormat_DATA_MATRIX)
|
||||
newHints |= BarcodeFormat::DATA_MATRIX;
|
||||
|
||||
if(hint & DecoderFormat_EAN_8)
|
||||
newHints |= BarcodeFormat::EAN_8;
|
||||
|
||||
if(hint & DecoderFormat_EAN_13)
|
||||
newHints |= BarcodeFormat::EAN_13;
|
||||
|
||||
if(hint & DecoderFormat_ITF)
|
||||
newHints |= BarcodeFormat::ITF;
|
||||
|
||||
if(hint & DecoderFormat_MAXICODE)
|
||||
newHints |= BarcodeFormat::MAXICODE;
|
||||
|
||||
if(hint & DecoderFormat_PDF_417)
|
||||
newHints |= BarcodeFormat::ITF;
|
||||
|
||||
if(hint & DecoderFormat_QR_CODE)
|
||||
newHints |= BarcodeFormat::QR_CODE;
|
||||
|
||||
if(hint & DecoderFormat_RSS_14)
|
||||
newHints |= BarcodeFormat::RSS_14;
|
||||
|
||||
if(hint & DecoderFormat_RSS_EXPANDED)
|
||||
newHints |= BarcodeFormat::RSS_EXPANDED;
|
||||
|
||||
if(hint & DecoderFormat_UPC_A)
|
||||
newHints |= BarcodeFormat::UPC_A;
|
||||
|
||||
if(hint & DecoderFormat_UPC_E)
|
||||
newHints |= BarcodeFormat::UPC_E;
|
||||
|
||||
if(hint & DecoderFormat_UPC_EAN_EXTENSION)
|
||||
newHints |= BarcodeFormat::UPC_EAN_EXTENSION;
|
||||
|
||||
supportedFormats = newHints;
|
||||
}
|
||||
|
||||
QString QZXing::decodeImage(QImage image)
|
||||
|
|
|
@ -41,6 +41,9 @@ typedef bool boolean;
|
|||
|
||||
#include <float.h>
|
||||
|
||||
// It is needed to undef the isnan, because the Mingw contains the C99 macro
|
||||
#undef isnan
|
||||
|
||||
namespace zxing {
|
||||
inline bool isnan(float v) {return _isnan(v) != 0;}
|
||||
inline bool isnan(double v) {return _isnan(v) != 0;}
|
||||
|
|
Loading…
Reference in New Issue