mirror of
https://github.com/status-im/qzxing.git
synced 2025-02-10 09:56:24 +00:00
applied patch from Alexxey593 from here: https://sourceforge.net/p/qzxing/discussion/general/thread/770fb0a5/#1d98
This commit is contained in:
parent
baf6d989ab
commit
a176fd841b
@ -11,6 +11,12 @@
|
|||||||
#include <QtQml/qqml.h>
|
#include <QtQml/qqml.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// forward declaration
|
||||||
|
namespace zxing {
|
||||||
|
class MultiFormatReader;
|
||||||
|
}
|
||||||
|
class ImageHandler;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A class containing a very very small subset of the ZXing library.
|
* A class containing a very very small subset of the ZXing library.
|
||||||
* Created for ease of use.
|
* Created for ease of use.
|
||||||
@ -143,9 +149,9 @@ signals:
|
|||||||
void enabledFormatsChanged();
|
void enabledFormatsChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void* decoder;
|
zxing::MultiFormatReader* decoder;
|
||||||
DecoderFormatType enabledDecoders;
|
DecoderFormatType enabledDecoders;
|
||||||
QObject* imageHandler;
|
ImageHandler* imageHandler;
|
||||||
int processingTime;
|
int processingTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -135,7 +135,7 @@ QString QZXing::decodeImage(QImage &image, int maxWidth, int maxHeight, bool smo
|
|||||||
|
|
||||||
Ref<BinaryBitmap> ref(bb);
|
Ref<BinaryBitmap> ref(bb);
|
||||||
|
|
||||||
res = ((MultiFormatReader*)decoder)->decode(ref, DecodeHints((int)enabledDecoders));
|
res = 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();
|
processingTime = t.elapsed();
|
||||||
@ -177,7 +177,7 @@ QString QZXing::decodeSubImageQML(QObject* item,
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
QImage img = ((ImageHandler*)imageHandler)->extractQImage(item, offsetX, offsetY, width, height);
|
QImage img = imageHandler->extractQImage(item, offsetX, offsetY, width, height);
|
||||||
|
|
||||||
return decodeImage(img);
|
return decodeImage(img);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user