This commit is contained in:
favoritas37 2015-06-01 16:58:16 +03:00
parent baf6d989ab
commit a176fd841b
2 changed files with 10 additions and 4 deletions

View File

@ -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;
/** /**

View File

@ -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);
} }