2011-11-16 13:40:46 +00:00
|
|
|
#ifndef CAMERAIMAGE_H
|
|
|
|
#define CAMERAIMAGE_H
|
|
|
|
|
|
|
|
#include <QImage>
|
|
|
|
#include <QString>
|
2013-07-27 17:01:25 +00:00
|
|
|
#include <zxing/zxing/LuminanceSource.h>
|
2011-11-16 13:40:46 +00:00
|
|
|
|
|
|
|
using namespace zxing;
|
|
|
|
|
|
|
|
class CameraImageWrapper : public LuminanceSource
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CameraImageWrapper();
|
2014-01-21 15:29:44 +00:00
|
|
|
CameraImageWrapper(const QImage& sourceImage);
|
2011-11-16 13:40:46 +00:00
|
|
|
CameraImageWrapper(CameraImageWrapper& otherInstance);
|
|
|
|
~CameraImageWrapper();
|
2014-01-21 15:29:44 +00:00
|
|
|
|
|
|
|
static CameraImageWrapper* Factory(const QImage& image, int maxWidth=-1, int maxHeight=-1, bool smoothTransformation=false);
|
2011-11-16 13:40:46 +00:00
|
|
|
|
|
|
|
int getWidth() const;
|
|
|
|
int getHeight() const;
|
|
|
|
|
|
|
|
unsigned char getPixel(int x, int y) const;
|
|
|
|
unsigned char* copyMatrix() const;
|
|
|
|
|
|
|
|
QImage grayScaleImage(QImage::Format f);
|
|
|
|
QImage getOriginalImage();
|
|
|
|
|
|
|
|
// Callers take ownership of the returned memory and must call delete [] on it themselves.
|
2013-07-27 17:01:25 +00:00
|
|
|
ArrayRef<char> getRow(int y, ArrayRef<char> row) const;
|
|
|
|
ArrayRef<char> getMatrix() const;
|
2011-11-16 13:40:46 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
QImage image;
|
|
|
|
unsigned char* pRow;
|
|
|
|
unsigned char* pMatrix;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif //CAMERAIMAGE_H
|