2014-12-20 14:07:15 +01:00
|
|
|
#ifndef IMAGE_H
|
|
|
|
#define IMAGE_H
|
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
#include <QMap>
|
|
|
|
|
|
|
|
#include <opencv2/core.hpp>
|
|
|
|
#include <opencv2/imgproc.hpp>
|
|
|
|
|
|
|
|
using namespace cv;
|
|
|
|
|
|
|
|
class Camera;
|
|
|
|
class Filter;
|
|
|
|
class Result;
|
|
|
|
|
|
|
|
class Image
|
|
|
|
{
|
2015-01-15 11:56:31 +01:00
|
|
|
public:
|
|
|
|
Image(Mat mat = Mat(), QString path = QString());
|
|
|
|
Image(QString p);
|
|
|
|
~Image();
|
2014-12-20 14:07:15 +01:00
|
|
|
|
2015-01-15 11:56:31 +01:00
|
|
|
void save(QString path = QString());
|
|
|
|
void load(QString path = QString());
|
2014-12-20 14:07:15 +01:00
|
|
|
|
2015-01-15 11:56:31 +01:00
|
|
|
void applyFilter(Filter *filter);
|
2014-12-20 14:07:15 +01:00
|
|
|
|
2015-01-15 11:56:31 +01:00
|
|
|
/* Getter */
|
|
|
|
bool isLoaded() const { return loaded; }
|
|
|
|
bool isSaved() const { return saved; }
|
2014-12-20 14:07:15 +01:00
|
|
|
|
2015-01-15 11:56:31 +01:00
|
|
|
Result * getResult(Filter *f) { return results[f]; }
|
|
|
|
QString getPath() { return path; }
|
|
|
|
Mat & getMat();
|
2014-12-20 14:07:15 +01:00
|
|
|
|
2015-01-15 11:56:31 +01:00
|
|
|
const Mat & getSourceMat();
|
|
|
|
void setSourceMat(const Mat &m);
|
2014-12-20 14:07:15 +01:00
|
|
|
|
2015-01-15 11:56:31 +01:00
|
|
|
protected:
|
|
|
|
QMap<Filter*, Result*> results;
|
2014-12-20 14:07:15 +01:00
|
|
|
|
2015-01-15 11:56:31 +01:00
|
|
|
QString path;
|
|
|
|
Mat source;
|
|
|
|
Mat filtered;
|
|
|
|
|
|
|
|
bool loaded;
|
|
|
|
bool saved;
|
2014-12-20 14:07:15 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // IMAGE_H
|