Merge /u/kl222/qzxing/ branch master into master

https://sourceforge.net/p/qzxing/code/merge-requests/5/
This commit is contained in:
Nikolaos Ftylitakis 2016-05-26 18:28:07 +00:00
commit 2b57ef7103
3 changed files with 36 additions and 9 deletions

View File

@ -9,7 +9,11 @@ CameraImageWrapper::CameraImageWrapper() : LuminanceSource(0,0), image(NULL)
CameraImageWrapper::CameraImageWrapper(const QImage &sourceImage) : LuminanceSource(sourceImage.width(), sourceImage.height())
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))
image = grayScaleImage( &sourceImage );
#else
image = new QImage(sourceImage);
#endif
delegate = Ref<GreyscaleLuminanceSource>(
new GreyscaleLuminanceSource(getMatrixP(),image->width(), image->height(),0, 0, image->width(), image->height()));
}
@ -42,6 +46,7 @@ CameraImageWrapper *CameraImageWrapper::Factory(const QImage &sourceImage, int m
return new CameraImageWrapper(sourceImage);
}
#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))
QImage* CameraImageWrapper::grayScaleImage(const QImage *origin)
{
QImage *tmp = new QImage(origin->width(), origin->height(), QImage::Format_Grayscale8);
@ -58,7 +63,7 @@ QImage* CameraImageWrapper::grayScaleImage(const QImage *origin)
return tmp;
}
#endif
QImage CameraImageWrapper::getOriginalImage()
{
return *image;
@ -128,8 +133,14 @@ ArrayRef<char> CameraImageWrapper::getRowP(int y, ArrayRef<char> row) const
row.reset(ArrayRef<char>(width));
for (int x = 0; x < width; x++)
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))
row[x] = image->pixel(x,y);
#else
QRgb pixel = image->pixel(x,y);
row[x] = qGray(pixel);
#endif
}
return row;
}

View File

@ -32,8 +32,9 @@ public:
private:
ArrayRef<char> getRowP(int y, ArrayRef<char> row) const;
ArrayRef<char> getMatrixP() const;
#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))
QImage* grayScaleImage(const QImage *origin);
#endif
unsigned int gray(unsigned int r, unsigned int g, unsigned int b);
QImage* image;

View File

@ -258,15 +258,30 @@ symbian {
Location
}
unix:!symbian {
maemo5 {
target.path = /opt/usr/lib
} else {
target.path = /usr/lib
!symbian {
isEmpty(PREFIX) {
maemo5 {
target.path = /opt/usr/lib
} else {
target.path = /usr/lib
}
}
DEFINES += NOFMAXL
INSTALLS += target
# Installation
headers.files = qzxing.h QZXing_global.h
headers.path = $$PREFIX/include
target.path = $$PREFIX/lib
INSTALLS += headers target
# pkg-config support
CONFIG += create_pc create_prl no_install_prl
QMAKE_PKGCONFIG_DESTDIR = pkgconfig
QMAKE_PKGCONFIG_LIBDIR = ${prefix}/lib
QMAKE_PKGCONFIG_INCDIR = ${prefix}/include
unix:QMAKE_CLEAN += -r pkgconfig lib$${TARGET}.prl
}
win32-msvc*{