pastie/image.h

74 lines
1.7 KiB
C
Raw Normal View History

2015-02-04 09:03:10 +01:00
/*
* This file is part of Pastie
*
* Pastie is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* Pastie is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Pastie. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @copyright 2015 Steffen Vogel
* @license http://www.gnu.org/licenses/gpl.txt GNU Public License
* @author Steffen Vogel <steffen.vogel@rwth-aachen.de>
* @link http://www.steffenvogel.de
*/
2014-12-20 14:07:15 +01:00
#ifndef IMAGE_H
#define IMAGE_H
#include <QString>
#include <QMap>
2015-01-29 01:05:57 +01:00
#include <QImage>
2014-12-20 14:07:15 +01:00
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
using namespace cv;
class Camera;
class Filter;
class Result;
class Image
{
public:
Image(Mat mat = Mat(), QString path = QString());
Image(QString p);
~Image();
2014-12-20 14:07:15 +01:00
void save(QString path = QString());
void load(QString path = QString());
2014-12-20 14:07:15 +01:00
/* Getter */
bool isLoaded() const { return loaded; }
bool isSaved() const { return saved; }
2014-12-20 14:07:15 +01:00
Result * getResult(Filter *f) { return results[f]; }
QString getPath() { return path; }
Mat & getMat();
2015-01-29 01:05:57 +01:00
QImage getQImage();
2014-12-20 14:07:15 +01:00
const Mat & getSourceMat();
void setSourceMat(const Mat &m);
2014-12-20 14:07:15 +01:00
QMap<Filter*, Result*> results;
2014-12-20 14:07:15 +01:00
2015-01-29 01:05:57 +01:00
protected:
QString path;
Mat source;
Mat filtered;
bool loaded;
bool saved;
2014-12-20 14:07:15 +01:00
};
#endif // IMAGE_H