-
Notifications
You must be signed in to change notification settings - Fork 0
/
ImageCanvas.h
64 lines (53 loc) · 1.18 KB
/
ImageCanvas.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* ImageCanvas.h
*
* Created on: Jun 3, 2010
* Author: Vincent
*/
#ifndef IMAGECANVAS_H_
#define IMAGECANVAS_H_
#include <QLabel>
#include <QBitmap>
#include "Grid.h"
#include "Patch.h"
class Processor;
class ImageCanvas: public QLabel {
Q_OBJECT
public:
ImageCanvas(QWidget * parent = 0);
virtual ~ImageCanvas();
public:
QBitmap getMask() const;
double getScale() const;
public slots:
void showGrid(bool show = true);
void hideGrid(bool hide = true);
void showPatches(bool show = true);
void hidePatches(bool hide = true);
void setScale(double imageScale);
void setImage(const QImage * image);
void updateImage();
void setProcessor(Processor * processor);
void setGrid(const Grid * grid);
void updateGrid();
void setPatches(const PatchList * patches);
void updatePatches();
void setImageInverted(bool inverted);
signals:
void imageScaleChanged(double imageScale);
protected:
void paintEvent(QPaintEvent *event);
private:
Processor *processor;
bool isGridShown;
bool isPatchesShown;
double scale;
const QImage * image;
const Grid *grid;
const PatchList *patches;
bool imageInverted;
private:
void init();
void scaleImage();
};
#endif /* IMAGECANVAS_H_ */