mirror of
https://github.com/status-im/qzxing.git
synced 2025-01-26 02:40:44 +00:00
Project compiles successfully on platforms: Win32 Mingw, Win32 MSVC, Symbian (these are tested till now). @ runtime still experiencing some issues that are being examined.
This commit is contained in:
parent
97eeb34772
commit
4367ec9d35
2
.gitignore
vendored
2
.gitignore
vendored
@ -12,3 +12,5 @@ Makefile
|
|||||||
*.user
|
*.user
|
||||||
*.mmp
|
*.mmp
|
||||||
*.pkg
|
*.pkg
|
||||||
|
QZXing-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK__Debug/
|
||||||
|
QZXing-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK__Release/
|
@ -164,7 +164,11 @@ ArrayRef<char> CameraImageWrapper::getMatrix() const
|
|||||||
{
|
{
|
||||||
ArrayRef<char> tmpRow;
|
ArrayRef<char> tmpRow;
|
||||||
tmpRow = getRow(y, ArrayRef<char>(width));
|
tmpRow = getRow(y, ArrayRef<char>(width));
|
||||||
memcpy(m, tmpRow->values().data(), width);
|
#if __cplusplus > 199711L
|
||||||
|
memcpy(m, tmpRow->values()..data(), width);
|
||||||
|
#else
|
||||||
|
memcpy(m, &tmpRow->values()[0], width);
|
||||||
|
#endif
|
||||||
m += width * sizeof(unsigned char);
|
m += width * sizeof(unsigned char);
|
||||||
|
|
||||||
//delete tmpRow;
|
//delete tmpRow;
|
||||||
|
@ -18,12 +18,19 @@
|
|||||||
*
|
*
|
||||||
* Regarding DecoderFormat, by default all of those are enabled (except DataMatrix will is still not supported)
|
* 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_OBJECT
|
||||||
Q_ENUMS(DecoderFormat)
|
Q_ENUMS(DecoderFormat)
|
||||||
|
Q_PROPERTY(int processingTime READ getProcessTimeOfLastDecoding)
|
||||||
|
Q_PROPERTY(uint enabledDecoders READ getEnabledFormats WRITE setDecoder NOTIFY enabledFormatsChanged)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/*
|
/*
|
||||||
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
enum DecoderFormat {
|
enum DecoderFormat {
|
||||||
@ -48,20 +55,12 @@ public:
|
|||||||
} ;
|
} ;
|
||||||
typedef unsigned int DecoderFormatType;
|
typedef unsigned int DecoderFormatType;
|
||||||
|
|
||||||
public:
|
|
||||||
QZXing(QObject *parent = NULL);
|
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
|
#if QT_VERSION >= 0x040700
|
||||||
static void registerQMLTypes()
|
static void registerQMLTypes()
|
||||||
{
|
{
|
||||||
qmlRegisterType<QZXing>("QZXing", 1, 2, "QZXing");
|
qmlRegisterType<QZXing>("QZXing", 2, 2, "QZXing");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -72,6 +71,12 @@ public slots:
|
|||||||
*/
|
*/
|
||||||
QString decodeImage(QImage image);
|
QString decodeImage(QImage image);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The decoding function accessible from QML
|
* The decoding function accessible from QML
|
||||||
*/
|
*/
|
||||||
@ -85,15 +90,32 @@ public slots:
|
|||||||
const double offsetX = 0 , const double offsetY = 0,
|
const double offsetX = 0 , const double offsetY = 0,
|
||||||
const double width = 0, const double height = 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();
|
||||||
|
|
||||||
|
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:
|
signals:
|
||||||
void decodingStarted();
|
void decodingStarted();
|
||||||
void decodingFinished(bool succeeded);
|
void decodingFinished(bool succeeded);
|
||||||
void tagFound(QString tag);
|
void tagFound(QString tag);
|
||||||
|
void enabledFormatsChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void* decoder;
|
void* decoder;
|
||||||
DecoderFormatType supportedFormats;
|
DecoderFormatType enabledDecoders;
|
||||||
QObject* imageHandler;
|
QObject* imageHandler;
|
||||||
|
int processingTime;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QZXING_H
|
#endif // QZXING_H
|
||||||
|
@ -3,193 +3,231 @@ QT += core gui
|
|||||||
greaterThan(QT_VERSION, 4.7): QT += declarative
|
greaterThan(QT_VERSION, 4.7): QT += declarative
|
||||||
|
|
||||||
DEFINES += QZXING_LIBRARY \
|
DEFINES += QZXING_LIBRARY \
|
||||||
ZXING_ICONV_CONST
|
ZXING_ICONV_CONST \
|
||||||
|
DISABLE_LIBRARY_FEATURES
|
||||||
|
|
||||||
INCLUDEPATH += $$PWD
|
INCLUDEPATH += $$PWD \
|
||||||
|
$$PWD/zxing
|
||||||
|
|
||||||
|
|
||||||
|
HEADERS += $$PWD/QZXing_global.h \
|
||||||
HEADERS += $$PWD/QZXing_global.h \
|
HEADERS += $$PWD/QZXing_global.h \
|
||||||
$$PWD/CameraImageWrapper.h \
|
$$PWD/CameraImageWrapper.h \
|
||||||
$$PWD/imagehandler.h \
|
$$PWD/imagehandler.h \
|
||||||
$$PWD/qzxing.h \
|
$$PWD/qzxing.h \
|
||||||
$$PWD/zxing/ResultPointCallback.h \
|
$$PWD/zxing/zxing/ZXing.h \
|
||||||
$$PWD/zxing/ResultPoint.h \
|
$$PWD/zxing/zxing/IllegalStateException.h \
|
||||||
$$PWD/zxing/Result.h \
|
$$PWD/zxing/zxing/InvertedLuminanceSource.h \
|
||||||
$$PWD/zxing/ReaderException.h \
|
$$PWD/zxing/zxing/ChecksumException.h \
|
||||||
$$PWD/zxing/Reader.h \
|
$$PWD/zxing/zxing/ResultPointCallback.h \
|
||||||
$$PWD/zxing/NotFoundException.h \
|
$$PWD/zxing/zxing/ResultPoint.h \
|
||||||
$$PWD/zxing/MultiFormatReader.h \
|
$$PWD/zxing/zxing/Result.h \
|
||||||
$$PWD/zxing/LuminanceSource.h \
|
$$PWD/zxing/zxing/ReaderException.h \
|
||||||
$$PWD/zxing/FormatException.h \
|
$$PWD/zxing/zxing/Reader.h \
|
||||||
$$PWD/zxing/Exception.h \
|
$$PWD/zxing/zxing/NotFoundException.h \
|
||||||
$$PWD/zxing/DecodeHints.h \
|
$$PWD/zxing/zxing/MultiFormatReader.h \
|
||||||
$$PWD/zxing/BinaryBitmap.h \
|
$$PWD/zxing/zxing/LuminanceSource.h \
|
||||||
$$PWD/zxing/Binarizer.h \
|
$$PWD/zxing/zxing/FormatException.h \
|
||||||
$$PWD/zxing/BarcodeFormat.h \
|
$$PWD/zxing/zxing/Exception.h \
|
||||||
$$PWD/zxing/aztec/AztecReader.h \
|
$$PWD/zxing/zxing/DecodeHints.h \
|
||||||
$$PWD/zxing/aztec/AztecDetectorResult.h \
|
$$PWD/zxing/zxing/BinaryBitmap.h \
|
||||||
$$PWD/zxing/aztec/decoder/Decoder.h \
|
$$PWD/zxing/zxing/Binarizer.h \
|
||||||
$$PWD/zxing/aztec/detector/Detector.h \
|
$$PWD/zxing/zxing/BarcodeFormat.h \
|
||||||
$$PWD/zxing/common/StringUtils.h \
|
$$PWD/zxing/zxing/aztec/AztecReader.h \
|
||||||
$$PWD/zxing/common/Str.h \
|
$$PWD/zxing/zxing/aztec/AztecDetectorResult.h \
|
||||||
$$PWD/zxing/common/Point.h \
|
$$PWD/zxing/zxing/aztec/decoder/Decoder.h \
|
||||||
$$PWD/zxing/common/PerspectiveTransform.h \
|
$$PWD/zxing/zxing/aztec/detector/Detector.h \
|
||||||
$$PWD/zxing/common/IllegalArgumentException.h \
|
$$PWD/zxing/zxing/common/StringUtils.h \
|
||||||
$$PWD/zxing/common/HybridBinarizer.h \
|
$$PWD/zxing/zxing/common/Str.h \
|
||||||
$$PWD/zxing/common/GridSampler.h \
|
$$PWD/zxing/zxing/common/Point.h \
|
||||||
$$PWD/zxing/common/GreyscaleRotatedLuminanceSource.h \
|
$$PWD/zxing/zxing/common/PerspectiveTransform.h \
|
||||||
$$PWD/zxing/common/GreyscaleLuminanceSource.h \
|
$$PWD/zxing/zxing/common/IllegalArgumentException.h \
|
||||||
$$PWD/zxing/common/GlobalHistogramBinarizer.h \
|
$$PWD/zxing/zxing/common/HybridBinarizer.h \
|
||||||
$$PWD/zxing/common/EdgeDetector.h \
|
$$PWD/zxing/zxing/common/GridSampler.h \
|
||||||
$$PWD/zxing/common/DetectorResult.h \
|
$$PWD/zxing/zxing/common/GreyscaleRotatedLuminanceSource.h \
|
||||||
$$PWD/zxing/common/DecoderResult.h \
|
$$PWD/zxing/zxing/common/GreyscaleLuminanceSource.h \
|
||||||
$$PWD/zxing/common/Counted.h \
|
$$PWD/zxing/zxing/common/GlobalHistogramBinarizer.h \
|
||||||
$$PWD/zxing/common/CharacterSetECI.h \
|
$$PWD/zxing/zxing/common/DetectorResult.h \
|
||||||
$$PWD/zxing/common/BitSource.h \
|
$$PWD/zxing/zxing/common/DecoderResult.h \
|
||||||
$$PWD/zxing/common/BitMatrix.h \
|
$$PWD/zxing/zxing/common/Counted.h \
|
||||||
$$PWD/zxing/common/BitArray.h \
|
$$PWD/zxing/zxing/common/CharacterSetECI.h \
|
||||||
$$PWD/zxing/common/Array.h \
|
$$PWD/zxing/zxing/common/BitSource.h \
|
||||||
$$PWD/zxing/common/detector/WhiteRectangleDetector.h \
|
$$PWD/zxing/zxing/common/BitMatrix.h \
|
||||||
$$PWD/zxing/common/detector/MonochromeRectangleDetector.h \
|
$$PWD/zxing/zxing/common/BitArray.h \
|
||||||
$$PWD/zxing/common/reedsolomon/ReedSolomonException.h \
|
$$PWD/zxing/zxing/common/Array.h \
|
||||||
$$PWD/zxing/common/reedsolomon/ReedSolomonDecoder.h \
|
$$PWD/zxing/zxing/common/detector/MathUtils.h \
|
||||||
$$PWD/zxing/common/reedsolomon/GenericGFPoly.h \
|
$$PWD/zxing/zxing/common/detector/JavaMath.h \
|
||||||
$$PWD/zxing/common/reedsolomon/GenericGF.h \
|
$$PWD/zxing/zxing/common/detector/WhiteRectangleDetector.h \
|
||||||
$$PWD/zxing/datamatrix/Version.h \
|
$$PWD/zxing/zxing/common/detector/MonochromeRectangleDetector.h \
|
||||||
$$PWD/zxing/datamatrix/DataMatrixReader.h \
|
$$PWD/zxing/zxing/common/reedsolomon/ReedSolomonException.h \
|
||||||
$$PWD/zxing/datamatrix/decoder/Decoder.h \
|
$$PWD/zxing/zxing/common/reedsolomon/ReedSolomonDecoder.h \
|
||||||
$$PWD/zxing/datamatrix/decoder/DecodedBitStreamParser.h \
|
$$PWD/zxing/zxing/common/reedsolomon/GenericGFPoly.h \
|
||||||
$$PWD/zxing/datamatrix/decoder/DataBlock.h \
|
$$PWD/zxing/zxing/common/reedsolomon/GenericGF.h \
|
||||||
$$PWD/zxing/datamatrix/decoder/BitMatrixParser.h \
|
$$PWD/zxing/zxing/datamatrix/Version.h \
|
||||||
$$PWD/zxing/datamatrix/detector/MonochromeRectangleDetector.h \
|
$$PWD/zxing/zxing/datamatrix/DataMatrixReader.h \
|
||||||
$$PWD/zxing/datamatrix/detector/DetectorException.h \
|
$$PWD/zxing/zxing/datamatrix/decoder/Decoder.h \
|
||||||
$$PWD/zxing/datamatrix/detector/Detector.h \
|
$$PWD/zxing/zxing/datamatrix/decoder/DecodedBitStreamParser.h \
|
||||||
$$PWD/zxing/datamatrix/detector/CornerPoint.h \
|
$$PWD/zxing/zxing/datamatrix/decoder/DataBlock.h \
|
||||||
$$PWD/zxing/oned/UPCEReader.h \
|
$$PWD/zxing/zxing/datamatrix/decoder/BitMatrixParser.h \
|
||||||
$$PWD/zxing/oned/UPCEANReader.h \
|
$$PWD/zxing/zxing/datamatrix/detector/DetectorException.h \
|
||||||
$$PWD/zxing/oned/UPCAReader.h \
|
$$PWD/zxing/zxing/datamatrix/detector/Detector.h \
|
||||||
$$PWD/zxing/oned/OneDResultPoint.h \
|
$$PWD/zxing/zxing/datamatrix/detector/CornerPoint.h \
|
||||||
$$PWD/zxing/oned/OneDReader.h \
|
$$PWD/zxing/zxing/oned/UPCEReader.h \
|
||||||
$$PWD/zxing/oned/MultiFormatUPCEANReader.h \
|
$$PWD/zxing/zxing/oned/UPCEANReader.h \
|
||||||
$$PWD/zxing/oned/MultiFormatOneDReader.h \
|
$$PWD/zxing/zxing/oned/UPCAReader.h \
|
||||||
$$PWD/zxing/oned/ITFReader.h \
|
$$PWD/zxing/zxing/oned/OneDResultPoint.h \
|
||||||
$$PWD/zxing/oned/EAN13Reader.h \
|
$$PWD/zxing/zxing/oned/OneDReader.h \
|
||||||
$$PWD/zxing/oned/EAN8Reader.h \
|
$$PWD/zxing/zxing/oned/MultiFormatUPCEANReader.h \
|
||||||
$$PWD/zxing/oned/Code128Reader.h \
|
$$PWD/zxing/zxing/oned/MultiFormatOneDReader.h \
|
||||||
$$PWD/zxing/oned/Code39Reader.h \
|
$$PWD/zxing/zxing/oned/ITFReader.h \
|
||||||
$$PWD/zxing/qrcode/Version.h \
|
$$PWD/zxing/zxing/oned/EAN13Reader.h \
|
||||||
$$PWD/zxing/qrcode/QRCodeReader.h \
|
$$PWD/zxing/zxing/oned/EAN8Reader.h \
|
||||||
$$PWD/zxing/qrcode/FormatInformation.h \
|
$$PWD/zxing/zxing/oned/Code128Reader.h \
|
||||||
$$PWD/zxing/qrcode/ErrorCorrectionLevel.h \
|
$$PWD/zxing/zxing/oned/Code39Reader.h \
|
||||||
$$PWD/zxing/qrcode/decoder/Mode.h \
|
$$PWD/zxing/zxing/oned/CodaBarReader.h \
|
||||||
$$PWD/zxing/qrcode/decoder/Decoder.h \
|
$$PWD/zxing/zxing/oned/Code93Reader.h \
|
||||||
$$PWD/zxing/qrcode/decoder/DecodedBitStreamParser.h \
|
$$PWD/zxing/zxing/qrcode/Version.h \
|
||||||
$$PWD/zxing/qrcode/decoder/DataMask.h \
|
$$PWD/zxing/zxing/qrcode/QRCodeReader.h \
|
||||||
$$PWD/zxing/qrcode/decoder/DataBlock.h \
|
$$PWD/zxing/zxing/qrcode/FormatInformation.h \
|
||||||
$$PWD/zxing/qrcode/decoder/BitMatrixParser.h \
|
$$PWD/zxing/zxing/qrcode/ErrorCorrectionLevel.h \
|
||||||
$$PWD/zxing/qrcode/detector/QREdgeDetector.h \
|
$$PWD/zxing/zxing/qrcode/decoder/Mode.h \
|
||||||
$$PWD/zxing/qrcode/detector/FinderPatternInfo.h \
|
$$PWD/zxing/zxing/qrcode/decoder/Decoder.h \
|
||||||
$$PWD/zxing/qrcode/detector/FinderPatternFinder.h \
|
$$PWD/zxing/zxing/qrcode/decoder/DecodedBitStreamParser.h \
|
||||||
$$PWD/zxing/qrcode/detector/FinderPattern.h \
|
$$PWD/zxing/zxing/qrcode/decoder/DataMask.h \
|
||||||
$$PWD/zxing/qrcode/detector/Detector.h \
|
$$PWD/zxing/zxing/qrcode/decoder/DataBlock.h \
|
||||||
$$PWD/zxing/qrcode/detector/AlignmentPatternFinder.h \
|
$$PWD/zxing/zxing/qrcode/decoder/BitMatrixParser.h \
|
||||||
$$PWD/zxing/qrcode/detector/AlignmentPattern.h \
|
$$PWD/zxing/zxing/qrcode/detector/FinderPatternInfo.h \
|
||||||
$$PWD/zxing/multi/MultipleBarcodeReader.h \
|
$$PWD/zxing/zxing/qrcode/detector/FinderPatternFinder.h \
|
||||||
$$PWD/zxing/multi/GenericMultipleBarcodeReader.h \
|
$$PWD/zxing/zxing/qrcode/detector/FinderPattern.h \
|
||||||
$$PWD/zxing/multi/ByQuadrantReader.h \
|
$$PWD/zxing/zxing/qrcode/detector/Detector.h \
|
||||||
$$PWD/zxing/multi/qrcode/QRCodeMultiReader.h \
|
$$PWD/zxing/zxing/qrcode/detector/AlignmentPatternFinder.h \
|
||||||
$$PWD/zxing/multi/qrcode/detector/MultiFinderPatternFinder.h \
|
$$PWD/zxing/zxing/qrcode/detector/AlignmentPattern.h \
|
||||||
$$PWD/zxing/multi/qrcode/detector/MultiDetector.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
|
||||||
|
|
||||||
SOURCES += $$PWD/CameraImageWrapper.cpp \
|
SOURCES += $$PWD/CameraImageWrapper.cpp \
|
||||||
$$PWD/qzxing.cpp \
|
$$PWD/qzxing.cpp \
|
||||||
$$PWD/imagehandler.cpp \
|
$$PWD/imagehandler.cpp \
|
||||||
$$PWD/zxing/ResultPointCallback.cpp \
|
$$PWD/zxing/zxing/ResultIO.cpp \
|
||||||
$$PWD/zxing/ResultPoint.cpp \
|
$$PWD/zxing/zxing/InvertedLuminanceSource.cpp \
|
||||||
$$PWD/zxing/Result.cpp \
|
$$PWD/zxing/zxing/ChecksumException.cpp \
|
||||||
$$PWD/zxing/ReaderException.cpp \
|
$$PWD/zxing/zxing/ResultPointCallback.cpp \
|
||||||
$$PWD/zxing/Reader.cpp \
|
$$PWD/zxing/zxing/ResultPoint.cpp \
|
||||||
$$PWD/zxing/NotFoundException.cpp \
|
$$PWD/zxing/zxing/Result.cpp \
|
||||||
$$PWD/zxing/MultiFormatReader.cpp \
|
$$PWD/zxing/zxing/Reader.cpp \
|
||||||
$$PWD/zxing/LuminanceSource.cpp \
|
$$PWD/zxing/zxing/MultiFormatReader.cpp \
|
||||||
$$PWD/zxing/FormatException.cpp \
|
$$PWD/zxing/zxing/LuminanceSource.cpp \
|
||||||
$$PWD/zxing/Exception.cpp \
|
$$PWD/zxing/zxing/FormatException.cpp \
|
||||||
$$PWD/zxing/DecodeHints.cpp \
|
$$PWD/zxing/zxing/Exception.cpp \
|
||||||
$$PWD/zxing/BinaryBitmap.cpp \
|
$$PWD/zxing/zxing/DecodeHints.cpp \
|
||||||
$$PWD/zxing/Binarizer.cpp \
|
$$PWD/zxing/zxing/BinaryBitmap.cpp \
|
||||||
$$PWD/zxing/BarcodeFormat.cpp \
|
$$PWD/zxing/zxing/Binarizer.cpp \
|
||||||
$$PWD/zxing/aztec/AztecReader.cpp \
|
$$PWD/zxing/zxing/BarcodeFormat.cpp \
|
||||||
$$PWD/zxing/aztec/AztecDetectorResult.cpp \
|
$$PWD/zxing/zxing/aztec/AztecReader.cpp \
|
||||||
$$PWD/zxing/common/StringUtils.cpp \
|
$$PWD/zxing/zxing/aztec/AztecDetectorResult.cpp \
|
||||||
$$PWD/zxing/common/Str.cpp \
|
$$PWD/zxing/zxing/common/StringUtils.cpp \
|
||||||
$$PWD/zxing/common/PerspectiveTransform.cpp \
|
$$PWD/zxing/zxing/common/Str.cpp \
|
||||||
$$PWD/zxing/common/IllegalArgumentException.cpp \
|
$$PWD/zxing/zxing/common/PerspectiveTransform.cpp \
|
||||||
$$PWD/zxing/common/HybridBinarizer.cpp \
|
$$PWD/zxing/zxing/common/IllegalArgumentException.cpp \
|
||||||
$$PWD/zxing/common/GridSampler.cpp \
|
$$PWD/zxing/zxing/common/HybridBinarizer.cpp \
|
||||||
$$PWD/zxing/common/GreyscaleRotatedLuminanceSource.cpp \
|
$$PWD/zxing/zxing/common/GridSampler.cpp \
|
||||||
$$PWD/zxing/common/GreyscaleLuminanceSource.cpp \
|
$$PWD/zxing/zxing/common/GreyscaleRotatedLuminanceSource.cpp \
|
||||||
$$PWD/zxing/common/GlobalHistogramBinarizer.cpp \
|
$$PWD/zxing/zxing/common/GreyscaleLuminanceSource.cpp \
|
||||||
$$PWD/zxing/common/EdgeDetector.cpp \
|
$$PWD/zxing/zxing/common/GlobalHistogramBinarizer.cpp \
|
||||||
$$PWD/zxing/common/DetectorResult.cpp \
|
$$PWD/zxing/zxing/common/DetectorResult.cpp \
|
||||||
$$PWD/zxing/common/DecoderResult.cpp \
|
$$PWD/zxing/zxing/common/DecoderResult.cpp \
|
||||||
$$PWD/zxing/common/Counted.cpp \
|
$$PWD/zxing/zxing/common/CharacterSetECI.cpp \
|
||||||
$$PWD/zxing/common/CharacterSetECI.cpp \
|
$$PWD/zxing/zxing/common/BitSource.cpp \
|
||||||
$$PWD/zxing/common/BitSource.cpp \
|
$$PWD/zxing/zxing/common/BitMatrix.cpp \
|
||||||
$$PWD/zxing/common/BitMatrix.cpp \
|
$$PWD/zxing/zxing/common/BitArray.cpp \
|
||||||
$$PWD/zxing/common/BitArray.cpp \
|
$$PWD/zxing/zxing/common/BitArrayIO.cpp \
|
||||||
$$PWD/zxing/common/Array.cpp \
|
$$PWD/zxing/zxing/common/detector/WhiteRectangleDetector.cpp \
|
||||||
$$PWD/zxing/common/detector/WhiteRectangleDetector.cpp \
|
$$PWD/zxing/zxing/common/detector/MonochromeRectangleDetector.cpp \
|
||||||
$$PWD/zxing/common/detector/MonochromeRectangleDetector.cpp \
|
$$PWD/zxing/zxing/common/reedsolomon/ReedSolomonException.cpp \
|
||||||
$$PWD/zxing/common/reedsolomon/ReedSolomonException.cpp \
|
$$PWD/zxing/zxing/common/reedsolomon/ReedSolomonDecoder.cpp \
|
||||||
$$PWD/zxing/common/reedsolomon/ReedSolomonDecoder.cpp \
|
$$PWD/zxing/zxing/common/reedsolomon/GenericGFPoly.cpp \
|
||||||
$$PWD/zxing/common/reedsolomon/GenericGFPoly.cpp \
|
$$PWD/zxing/zxing/common/reedsolomon/GenericGF.cpp \
|
||||||
$$PWD/zxing/common/reedsolomon/GenericGF.cpp \
|
$$PWD/zxing/zxing/datamatrix/DataMatrixReader.cpp \
|
||||||
$$PWD/zxing/datamatrix/DataMatrixReader.cpp \
|
$$PWD/zxing/zxing/oned/UPCEReader.cpp \
|
||||||
$$PWD/zxing/oned/UPCEReader.cpp \
|
$$PWD/zxing/zxing/oned/UPCEANReader.cpp \
|
||||||
$$PWD/zxing/oned/UPCEANReader.cpp \
|
$$PWD/zxing/zxing/oned/UPCAReader.cpp \
|
||||||
$$PWD/zxing/oned/UPCAReader.cpp \
|
$$PWD/zxing/zxing/oned/OneDResultPoint.cpp \
|
||||||
$$PWD/zxing/oned/OneDResultPoint.cpp \
|
$$PWD/zxing/zxing/oned/OneDReader.cpp \
|
||||||
$$PWD/zxing/oned/OneDReader.cpp \
|
$$PWD/zxing/zxing/oned/MultiFormatUPCEANReader.cpp \
|
||||||
$$PWD/zxing/oned/MultiFormatUPCEANReader.cpp \
|
$$PWD/zxing/zxing/oned/MultiFormatOneDReader.cpp \
|
||||||
$$PWD/zxing/oned/MultiFormatOneDReader.cpp \
|
$$PWD/zxing/zxing/oned/ITFReader.cpp \
|
||||||
$$PWD/zxing/oned/ITFReader.cpp \
|
$$PWD/zxing/zxing/oned/EAN13Reader.cpp \
|
||||||
$$PWD/zxing/oned/EAN13Reader.cpp \
|
$$PWD/zxing/zxing/oned/EAN8Reader.cpp \
|
||||||
$$PWD/zxing/oned/EAN8Reader.cpp \
|
$$PWD/zxing/zxing/oned/Code128Reader.cpp \
|
||||||
$$PWD/zxing/oned/Code128Reader.cpp \
|
$$PWD/zxing/zxing/oned/Code39Reader.cpp \
|
||||||
$$PWD/zxing/oned/Code39Reader.cpp \
|
$$PWD/zxing/zxing/oned/CodaBarReader.cpp \
|
||||||
$$PWD/zxing/qrcode/QRCodeReader.cpp \
|
$$PWD/zxing/zxing/oned/Code93Reader.cpp \
|
||||||
$$PWD/zxing/qrcode/detector/QREdgeDetector.cpp \
|
$$PWD/zxing/zxing/qrcode/QRCodeReader.cpp \
|
||||||
$$PWD/zxing/multi/MultipleBarcodeReader.cpp \
|
$$PWD/zxing/zxing/multi/MultipleBarcodeReader.cpp \
|
||||||
$$PWD/zxing/multi/GenericMultipleBarcodeReader.cpp \
|
$$PWD/zxing/zxing/multi/GenericMultipleBarcodeReader.cpp \
|
||||||
$$PWD/zxing/multi/ByQuadrantReader.cpp \
|
$$PWD/zxing/zxing/multi/ByQuadrantReader.cpp \
|
||||||
$$PWD/zxing/multi/qrcode/QRCodeMultiReader.cpp \
|
$$PWD/zxing/zxing/multi/qrcode/QRCodeMultiReader.cpp \
|
||||||
$$PWD/zxing/multi/qrcode/detector/MultiFinderPatternFinder.cpp \
|
$$PWD/zxing/zxing/multi/qrcode/detector/MultiFinderPatternFinder.cpp \
|
||||||
$$PWD/zxing/multi/qrcode/detector/MultiDetector.cpp \
|
$$PWD/zxing/zxing/multi/qrcode/detector/MultiDetector.cpp \
|
||||||
$$PWD/zxing/aztec/decoder/AztecDecoder.cpp \
|
$$PWD/zxing/zxing/aztec/decoder/AztecDecoder.cpp \
|
||||||
$$PWD/zxing/aztec/detector/AztecDetector.cpp \
|
$$PWD/zxing/zxing/aztec/detector/AztecDetector.cpp \
|
||||||
$$PWD/zxing/datamatrix/DataMatrixVersion.cpp \
|
$$PWD/zxing/zxing/datamatrix/DataMatrixVersion.cpp \
|
||||||
$$PWD/zxing/datamatrix/decoder/DataMatrixDecoder.cpp \
|
$$PWD/zxing/zxing/datamatrix/decoder/DataMatrixDecoder.cpp \
|
||||||
$$PWD/zxing/datamatrix/decoder/DataMatrixBitMatrixParser.cpp \
|
$$PWD/zxing/zxing/datamatrix/decoder/DataMatrixBitMatrixParser.cpp \
|
||||||
$$PWD/zxing/datamatrix/decoder/DataMatrixDataBlock.cpp \
|
$$PWD/zxing/zxing/datamatrix/decoder/DataMatrixDataBlock.cpp \
|
||||||
$$PWD/zxing/datamatrix/decoder/DataMatrixDecodedBitStreamParser.cpp \
|
$$PWD/zxing/zxing/datamatrix/decoder/DataMatrixDecodedBitStreamParser.cpp \
|
||||||
$$PWD/zxing/datamatrix/detector/DataMatrixCornerPoint.cpp \
|
$$PWD/zxing/zxing/datamatrix/detector/DataMatrixCornerPoint.cpp \
|
||||||
$$PWD/zxing/datamatrix/detector/DataMatrixDetector.cpp \
|
$$PWD/zxing/zxing/datamatrix/detector/DataMatrixDetector.cpp \
|
||||||
$$PWD/zxing/datamatrix/detector/DataMatrixDetectorException.cpp \
|
$$PWD/zxing/zxing/datamatrix/detector/DataMatrixDetectorException.cpp \
|
||||||
$$PWD/zxing/datamatrix/detector/DataMatrixMonochromeRectangleDetector.cpp \
|
$$PWD/zxing/zxing/qrcode/decoder/QRBitMatrixParser.cpp \
|
||||||
$$PWD/zxing/qrcode/decoder/QRBitMatrixParser.cpp \
|
$$PWD/zxing/zxing/qrcode/decoder/QRDataBlock.cpp \
|
||||||
$$PWD/zxing/qrcode/decoder/QRDataBlock.cpp \
|
$$PWD/zxing/zxing/qrcode/decoder/QRDataMask.cpp \
|
||||||
$$PWD/zxing/qrcode/decoder/QRDataMask.cpp \
|
$$PWD/zxing/zxing/qrcode/decoder/QRDecodedBitStreamParser.cpp \
|
||||||
$$PWD/zxing/qrcode/decoder/QRDecodedBitStreamParser.cpp \
|
$$PWD/zxing/zxing/qrcode/decoder/QRDecoder.cpp \
|
||||||
$$PWD/zxing/qrcode/decoder/QRDecoder.cpp \
|
$$PWD/zxing/zxing/qrcode/decoder/QRMode.cpp \
|
||||||
$$PWD/zxing/qrcode/decoder/QRMode.cpp \
|
$$PWD/zxing/zxing/qrcode/detector/QRAlignmentPattern.cpp \
|
||||||
$$PWD/zxing/qrcode/detector/QRAlignmentPattern.cpp \
|
$$PWD/zxing/zxing/qrcode/detector/QRAlignmentPatternFinder.cpp \
|
||||||
$$PWD/zxing/qrcode/detector/QRAlignmentPatternFinder.cpp \
|
$$PWD/zxing/zxing/qrcode/detector/QRDetector.cpp \
|
||||||
$$PWD/zxing/qrcode/detector/QRDetector.cpp \
|
$$PWD/zxing/zxing/qrcode/detector/QRFinderPattern.cpp \
|
||||||
$$PWD/zxing/qrcode/detector/QRFinderPattern.cpp \
|
$$PWD/zxing/zxing/qrcode/detector/QRFinderPatternFinder.cpp \
|
||||||
$$PWD/zxing/qrcode/detector/QRFinderPatternFinder.cpp \
|
$$PWD/zxing/zxing/qrcode/detector/QRFinderPatternInfo.cpp \
|
||||||
$$PWD/zxing/qrcode/detector/QRFinderPatternInfo.cpp \
|
$$PWD/zxing/zxing/qrcode/QRVersion.cpp \
|
||||||
$$PWD/zxing/qrcode/QRVersion.cpp \
|
$$PWD/zxing/zxing/qrcode/QRFormatInformation.cpp \
|
||||||
$$PWD/zxing/qrcode/QRFormatInformation.cpp \
|
$$PWD/zxing/zxing/qrcode/QRErrorCorrectionLevel.cpp \
|
||||||
$$PWD/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
|
||||||
|
|
||||||
symbian {
|
symbian {
|
||||||
TARGET.UID3 = 0xE618743C
|
TARGET.UID3 = 0xE618743C
|
||||||
@ -215,6 +253,21 @@ unix:!symbian {
|
|||||||
INSTALLS += target
|
INSTALLS += target
|
||||||
}
|
}
|
||||||
|
|
||||||
win32{
|
win32-msvc*{
|
||||||
DEFINES += NO_ICONV
|
|
||||||
|
INCLUDEPATH += $$PWD/zxing/win32/zxing \
|
||||||
|
$$PWD/zxing/win32/zxing/stdint
|
||||||
|
HEADERS += $$PWD/zxing/win32/zxing/stdint/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
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
#-------------------------------------------------
|
|
||||||
#
|
|
||||||
# Project created by QtCreator 2011-11-13T18:12:28
|
|
||||||
#
|
|
||||||
#-------------------------------------------------
|
|
||||||
|
|
||||||
QT += core gui
|
QT += core gui
|
||||||
|
|
||||||
@ -135,7 +131,6 @@ HEADERS += QZXing_global.h \
|
|||||||
zxing/bigint/BigIntegerLibrary.hh \
|
zxing/bigint/BigIntegerLibrary.hh \
|
||||||
zxing/bigint/BigIntegerAlgorithms.hh \
|
zxing/bigint/BigIntegerAlgorithms.hh \
|
||||||
zxing/bigint/BigInteger.hh \
|
zxing/bigint/BigInteger.hh \
|
||||||
zxing/win32/zxing/stdint.h \
|
|
||||||
zxing/win32/zxing/iconv.h
|
zxing/win32/zxing/iconv.h
|
||||||
|
|
||||||
SOURCES += CameraImageWrapper.cpp \
|
SOURCES += CameraImageWrapper.cpp \
|
||||||
@ -269,8 +264,16 @@ unix:!symbian {
|
|||||||
INSTALLS += target
|
INSTALLS += target
|
||||||
}
|
}
|
||||||
|
|
||||||
win32{
|
win32-msvc*{
|
||||||
DEFINES += NO_ICONV
|
|
||||||
|
INCLUDEPATH += zxing/win32/zxing \
|
||||||
|
zxing/win32/zxing/stdint
|
||||||
|
HEADERS += zxing/win32/zxing/stdint/stdint.h
|
||||||
|
}
|
||||||
|
|
||||||
|
win32-g++{
|
||||||
|
INCLUDEPATH += zxing/win32/zxing
|
||||||
|
# DEFINES += NO_ICONV
|
||||||
}
|
}
|
||||||
|
|
||||||
OTHER_FILES += \
|
OTHER_FILES += \
|
||||||
|
@ -7,13 +7,14 @@
|
|||||||
#include <zxing/DecodeHints.h>
|
#include <zxing/DecodeHints.h>
|
||||||
#include "CameraImageWrapper.h"
|
#include "CameraImageWrapper.h"
|
||||||
#include "imagehandler.h"
|
#include "imagehandler.h"
|
||||||
|
#include <QTime>
|
||||||
|
|
||||||
using namespace zxing;
|
using namespace zxing;
|
||||||
|
|
||||||
QZXing::QZXing(QObject *parent) : QObject(parent)
|
QZXing::QZXing(QObject *parent) : QObject(parent)
|
||||||
{
|
{
|
||||||
decoder = new MultiFormatReader();
|
decoder = new MultiFormatReader();
|
||||||
setDecoder(DecoderFormat_QR_CODE |
|
/*setDecoder(DecoderFormat_QR_CODE |
|
||||||
DecoderFormat_DATA_MATRIX |
|
DecoderFormat_DATA_MATRIX |
|
||||||
DecoderFormat_UPC_E |
|
DecoderFormat_UPC_E |
|
||||||
DecoderFormat_UPC_A |
|
DecoderFormat_UPC_A |
|
||||||
@ -22,11 +23,11 @@ QZXing::QZXing(QObject *parent) : QObject(parent)
|
|||||||
DecoderFormat_CODE_128 |
|
DecoderFormat_CODE_128 |
|
||||||
DecoderFormat_CODE_39 |
|
DecoderFormat_CODE_39 |
|
||||||
DecoderFormat_ITF |
|
DecoderFormat_ITF |
|
||||||
DecoderFormat_Aztec);
|
DecoderFormat_Aztec);*/
|
||||||
imageHandler = new ImageHandler();
|
imageHandler = new ImageHandler();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QZXing::setDecoder(DecoderFormatType hint)
|
void QZXing::setDecoder(const uint &hint)
|
||||||
{
|
{
|
||||||
unsigned int newHints = 0;
|
unsigned int newHints = 0;
|
||||||
|
|
||||||
@ -81,14 +82,25 @@ void QZXing::setDecoder(DecoderFormatType hint)
|
|||||||
if(hint & DecoderFormat_UPC_EAN_EXTENSION)
|
if(hint & DecoderFormat_UPC_EAN_EXTENSION)
|
||||||
newHints |= BarcodeFormat::UPC_EAN_EXTENSION;
|
newHints |= BarcodeFormat::UPC_EAN_EXTENSION;
|
||||||
|
|
||||||
supportedFormats = newHints;
|
enabledDecoders = newHints;
|
||||||
|
|
||||||
|
emit enabledFormatsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QZXing::decodeImage(QImage image)
|
QString QZXing::decodeImage(QImage image)
|
||||||
{
|
{
|
||||||
|
QTime t;
|
||||||
|
t.start();
|
||||||
Ref<Result> res;
|
Ref<Result> res;
|
||||||
emit decodingStarted();
|
emit decodingStarted();
|
||||||
|
|
||||||
|
if(image.isNull())
|
||||||
|
{
|
||||||
|
emit decodingFinished(false);
|
||||||
|
processingTime = -1;
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
try{
|
try{
|
||||||
Ref<LuminanceSource> imageRef(new CameraImageWrapper(image));
|
Ref<LuminanceSource> imageRef(new CameraImageWrapper(image));
|
||||||
GlobalHistogramBinarizer* binz = new GlobalHistogramBinarizer(imageRef);
|
GlobalHistogramBinarizer* binz = new GlobalHistogramBinarizer(imageRef);
|
||||||
@ -98,9 +110,10 @@ QString QZXing::decodeImage(QImage image)
|
|||||||
|
|
||||||
Ref<BinaryBitmap> ref(bb);
|
Ref<BinaryBitmap> ref(bb);
|
||||||
|
|
||||||
res = ((MultiFormatReader*)decoder)->decode(ref, DecodeHints((int)supportedFormats));
|
res = ((MultiFormatReader*)decoder)->decode(ref, DecodeHints((int)enabledDecoders));
|
||||||
|
|
||||||
QString string = QString(res->getText()->getText().c_str());
|
QString string = QString(res->getText()->getText().c_str());
|
||||||
|
processingTime = t.elapsed();
|
||||||
emit tagFound(string);
|
emit tagFound(string);
|
||||||
emit decodingFinished(true);
|
emit decodingFinished(true);
|
||||||
return string;
|
return string;
|
||||||
@ -108,10 +121,19 @@ QString QZXing::decodeImage(QImage image)
|
|||||||
catch(zxing::Exception& e)
|
catch(zxing::Exception& e)
|
||||||
{
|
{
|
||||||
emit decodingFinished(false);
|
emit decodingFinished(false);
|
||||||
|
processingTime = -1;
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString QZXing::decodeImageFromFile(QString imageFilePath)
|
||||||
|
{
|
||||||
|
//used to have a check if this image exists
|
||||||
|
//but was removed because if the image file path doesn't point to a valid image
|
||||||
|
// then the QImage::isNull will return true and the decoding will fail eitherway.
|
||||||
|
return decodeImage(QImage(imageFilePath));
|
||||||
|
}
|
||||||
|
|
||||||
QString QZXing::decodeImageQML(QObject *item)
|
QString QZXing::decodeImageQML(QObject *item)
|
||||||
{
|
{
|
||||||
return decodeSubImageQML(item);
|
return decodeSubImageQML(item);
|
||||||
@ -132,4 +154,16 @@ QString QZXing::decodeSubImageQML(QObject* item,
|
|||||||
return decodeImage(img);
|
return decodeImage(img);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int QZXing::getProcessTimeOfLastDecoding()
|
||||||
|
{
|
||||||
|
return processingTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint QZXing::getEnabledFormats() const
|
||||||
|
{
|
||||||
|
return enabledDecoders;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,7 +29,9 @@ using zxing::DecodeHints;
|
|||||||
// VC++
|
// VC++
|
||||||
using zxing::BarcodeFormat;
|
using zxing::BarcodeFormat;
|
||||||
|
|
||||||
|
#ifndef _MSC_VER
|
||||||
const DecodeHintType DecodeHints::CHARACTER_SET;
|
const DecodeHintType DecodeHints::CHARACTER_SET;
|
||||||
|
#endif
|
||||||
|
|
||||||
const DecodeHints DecodeHints::PRODUCT_HINT(
|
const DecodeHints DecodeHints::PRODUCT_HINT(
|
||||||
UPC_A_HINT |
|
UPC_A_HINT |
|
||||||
|
@ -40,23 +40,34 @@ typedef bool boolean;
|
|||||||
#if defined(_WIN32) || defined(_WIN64)
|
#if defined(_WIN32) || defined(_WIN64)
|
||||||
|
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
// It is needed to undef the isnan, because the Mingw contains the C99 macro
|
// It is needed to undef the isnan, because the Mingw contains the C99 macro
|
||||||
#undef isnan
|
#undef isnan
|
||||||
|
|
||||||
namespace zxing {
|
namespace zxing {
|
||||||
inline bool isnan(float v) {return _isnan(v) != 0;}
|
inline bool isnan_z(float v) {return _isnan(v) != 0;}
|
||||||
inline bool isnan(double v) {return _isnan(v) != 0;}
|
inline bool isnan_z(double v) {return _isnan(v) != 0;}
|
||||||
inline float nan() {return std::numeric_limits<float>::quiet_NaN();}
|
inline float nan() {return std::numeric_limits<float>::quiet_NaN();}
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#include <cmath>
|
#include <math.h>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
namespace zxing {
|
namespace zxing {
|
||||||
inline bool isnan(float v) {return std::isnan(v);}
|
inline bool isnan_z(float v) {
|
||||||
inline bool isnan(double v) {return std::isnan(v);}
|
return /*std::*/isnan(v);
|
||||||
|
}
|
||||||
|
inline bool isnan_z(double v) {
|
||||||
|
return /*std::*/isnan(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
//#undef isfinite
|
||||||
|
//#undef signbit
|
||||||
|
|
||||||
inline float nan() {return std::numeric_limits<float>::quiet_NaN();}
|
inline float nan() {return std::numeric_limits<float>::quiet_NaN();}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ void EAN13Reader::determineFirstDigit(std::string& resultString, int lgPatternFo
|
|||||||
// std::cerr << "K " << resultString << " " << lgPatternFound << " " <<FIRST_DIGIT_ENCODINGS << std::endl;
|
// std::cerr << "K " << resultString << " " << lgPatternFound << " " <<FIRST_DIGIT_ENCODINGS << std::endl;
|
||||||
for (int d = 0; d < 10; d++) {
|
for (int d = 0; d < 10; d++) {
|
||||||
if (lgPatternFound == FIRST_DIGIT_ENCODINGS[d]) {
|
if (lgPatternFound == FIRST_DIGIT_ENCODINGS[d]) {
|
||||||
resultString.insert(0, 1, (char) ('0' + d));
|
resultString.insert((size_t)0, (size_t)1, (char) ('0' + d));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ bool UPCEReader::determineNumSysAndCheckDigit(std::string& resultString, int lgP
|
|||||||
for (int numSys = 0; numSys <= 1; numSys++) {
|
for (int numSys = 0; numSys <= 1; numSys++) {
|
||||||
for (int d = 0; d < 10; d++) {
|
for (int d = 0; d < 10; d++) {
|
||||||
if (lgPatternFound == NUMSYS_AND_CHECK_DIGIT_PATTERNS[numSys][d]) {
|
if (lgPatternFound == NUMSYS_AND_CHECK_DIGIT_PATTERNS[numSys][d]) {
|
||||||
resultString.insert(0, 1, (char) ('0' + numSys));
|
resultString.insert((size_t)0, (size_t)1, (char) ('0' + numSys));
|
||||||
resultString.append(1, (char) ('0' + d));
|
resultString.append(1, (char) ('0' + d));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -36,10 +36,12 @@ using zxing::Point;
|
|||||||
// VC++
|
// VC++
|
||||||
using zxing::Line;
|
using zxing::Line;
|
||||||
|
|
||||||
|
#ifndef _MSC_VER
|
||||||
const int LinesSampler::MODULES_IN_SYMBOL;
|
const int LinesSampler::MODULES_IN_SYMBOL;
|
||||||
const int LinesSampler::BARS_IN_SYMBOL;
|
const int LinesSampler::BARS_IN_SYMBOL;
|
||||||
const int LinesSampler::POSSIBLE_SYMBOLS;
|
const int LinesSampler::POSSIBLE_SYMBOLS;
|
||||||
const int LinesSampler::BARCODE_START_OFFSET;
|
const int LinesSampler::BARCODE_START_OFFSET;
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include <zxing/common/CharacterSetECI.h>
|
#include <zxing/common/CharacterSetECI.h>
|
||||||
#include <zxing/FormatException.h>
|
#include <zxing/FormatException.h>
|
||||||
#include <zxing/common/StringUtils.h>
|
#include <zxing/common/StringUtils.h>
|
||||||
|
#include <qglobal.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#ifndef NO_ICONV
|
#ifndef NO_ICONV
|
||||||
#include <iconv.h>
|
#include <iconv.h>
|
||||||
@ -82,7 +83,11 @@ void DecodedBitStreamParser::append(std::string &result,
|
|||||||
size_t nTo = maxOut;
|
size_t nTo = maxOut;
|
||||||
|
|
||||||
while (nFrom > 0) {
|
while (nFrom > 0) {
|
||||||
|
#ifdef Q_OS_SYMBIAN
|
||||||
size_t oneway = iconv(cd, &fromPtr, &nFrom, &toPtr, &nTo);
|
size_t oneway = iconv(cd, &fromPtr, &nFrom, &toPtr, &nTo);
|
||||||
|
#else
|
||||||
|
size_t oneway = iconv(cd, (char**)&fromPtr, &nFrom, &toPtr, &nTo);
|
||||||
|
#endif
|
||||||
if (oneway == (size_t)(-1)) {
|
if (oneway == (size_t)(-1)) {
|
||||||
iconv_close(cd);
|
iconv_close(cd);
|
||||||
delete[] bufOut;
|
delete[] bufOut;
|
||||||
|
@ -100,7 +100,7 @@ Ref<AlignmentPattern> AlignmentPatternFinder::handlePossibleCenter(vector<int> &
|
|||||||
int stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2];
|
int stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2];
|
||||||
float centerJ = centerFromEnd(stateCount, j);
|
float centerJ = centerFromEnd(stateCount, j);
|
||||||
float centerI = crossCheckVertical(i, (int)centerJ, 2 * stateCount[1], stateCountTotal);
|
float centerI = crossCheckVertical(i, (int)centerJ, 2 * stateCount[1], stateCountTotal);
|
||||||
if (!isnan(centerI)) {
|
if (!zxing::isnan_z(centerI)) {
|
||||||
float estimatedModuleSize = (float)(stateCount[0] + stateCount[1] + stateCount[2]) / 3.0f;
|
float estimatedModuleSize = (float)(stateCount[0] + stateCount[1] + stateCount[2]) / 3.0f;
|
||||||
int max = possibleCenters_->size();
|
int max = possibleCenters_->size();
|
||||||
for (int index = 0; index < max; index++) {
|
for (int index = 0; index < max; index++) {
|
||||||
|
@ -195,10 +195,10 @@ float Detector::calculateModuleSizeOneWay(Ref<ResultPoint> pattern, Ref<ResultPo
|
|||||||
(int)otherPattern->getX(), (int)otherPattern->getY());
|
(int)otherPattern->getX(), (int)otherPattern->getY());
|
||||||
float moduleSizeEst2 = sizeOfBlackWhiteBlackRunBothWays((int)otherPattern->getX(), (int)otherPattern->getY(),
|
float moduleSizeEst2 = sizeOfBlackWhiteBlackRunBothWays((int)otherPattern->getX(), (int)otherPattern->getY(),
|
||||||
(int)pattern->getX(), (int)pattern->getY());
|
(int)pattern->getX(), (int)pattern->getY());
|
||||||
if (zxing::isnan(moduleSizeEst1)) {
|
if (zxing::isnan_z(moduleSizeEst1)) {
|
||||||
return moduleSizeEst2;
|
return moduleSizeEst2;
|
||||||
}
|
}
|
||||||
if (zxing::isnan(moduleSizeEst2)) {
|
if (zxing::isnan_z(moduleSizeEst2)) {
|
||||||
return moduleSizeEst1;
|
return moduleSizeEst1;
|
||||||
}
|
}
|
||||||
// Average them, and divide by 7 since we've counted the width of 3 black modules,
|
// Average them, and divide by 7 since we've counted the width of 3 black modules,
|
||||||
|
@ -238,10 +238,10 @@ bool FinderPatternFinder::handlePossibleCenter(int* stateCount, size_t i, size_t
|
|||||||
int stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2] + stateCount[3] + stateCount[4];
|
int stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2] + stateCount[3] + stateCount[4];
|
||||||
float centerJ = centerFromEnd(stateCount, j);
|
float centerJ = centerFromEnd(stateCount, j);
|
||||||
float centerI = crossCheckVertical(i, (size_t)centerJ, stateCount[2], stateCountTotal);
|
float centerI = crossCheckVertical(i, (size_t)centerJ, stateCount[2], stateCountTotal);
|
||||||
if (!isnan(centerI)) {
|
if (!zxing::isnan_z(centerI)) {
|
||||||
// Re-cross check
|
// Re-cross check
|
||||||
centerJ = crossCheckHorizontal((size_t)centerJ, (size_t)centerI, stateCount[2], stateCountTotal);
|
centerJ = crossCheckHorizontal((size_t)centerJ, (size_t)centerI, stateCount[2], stateCountTotal);
|
||||||
if (!isnan(centerJ)) {
|
if (!zxing::isnan_z(centerJ)) {
|
||||||
float estimatedModuleSize = (float)stateCountTotal / 7.0f;
|
float estimatedModuleSize = (float)stateCountTotal / 7.0f;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
size_t max = possibleCenters_.size();
|
size_t max = possibleCenters_.size();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user