2010-05-06 04:18:01 -07:00
|
|
|
#ifndef CAMERAIMAGE_H
|
|
|
|
#define CAMERAIMAGE_H
|
|
|
|
|
|
|
|
#include <QImage>
|
|
|
|
#include <QString>
|
|
|
|
#include <zxing/LuminanceSource.h>
|
|
|
|
|
|
|
|
using namespace zxing;
|
|
|
|
|
|
|
|
class CameraImageWrapper : public LuminanceSource
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CameraImageWrapper();
|
|
|
|
CameraImageWrapper(CameraImageWrapper& otherInstance);
|
|
|
|
~CameraImageWrapper();
|
|
|
|
|
2010-05-06 13:19:38 -07:00
|
|
|
int getWidth() const;
|
|
|
|
int getHeight() const;
|
2010-05-06 04:18:01 -07:00
|
|
|
|
2010-05-06 13:19:38 -07:00
|
|
|
unsigned char getPixel(int x, int y) const;
|
|
|
|
unsigned char* copyMatrix() const;
|
2010-05-06 04:18:01 -07:00
|
|
|
|
2010-05-06 13:19:38 -07:00
|
|
|
void setImage(QString fileName);
|
2010-05-06 04:18:01 -07:00
|
|
|
void setImage(QImage newImage);
|
|
|
|
QImage grayScaleImage(QImage::Format f);
|
|
|
|
QImage getOriginalImage();
|
|
|
|
|
|
|
|
private:
|
|
|
|
QImage image;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif //CAMERAIMAGE_H
|