-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathscribbleimagedisplaywidget.h
71 lines (47 loc) · 1.49 KB
/
scribbleimagedisplaywidget.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
65
66
67
68
69
70
71
#ifndef TVSEG_UI_SCRIBBLEIMAGEWIDGET_H
#define TVSEG_UI_SCRIBBLEIMAGEWIDGET_H
#include "cvimagedisplaywidget.h"
namespace tvseg_ui {
class ScribbleImageDisplayWidget: public CvImageDisplayWidget
{
Q_OBJECT
public:
explicit ScribbleImageDisplayWidget(QWidget *parent = 0);
void setImage(cv::Mat image);
void setImage(cv::Mat image, bool keepImage);
void clearImage();
void setLabels(cv::Mat labels);
void setLabels(QVector<QRgb> labelColors);
QVector<QVector<QPoint> > getScribbles();
void setScribbles(QVector<QVector<QPoint> > scribbles);
uint brushSize() const;
void setBrushSize(uint value);
float brushDensity() const;
void setBrushDensity(float value);
protected slots:
void clearScribbles();
protected:
bool eventFilter(QObject *obj, QEvent *event);
void keyPressEvent(QKeyEvent * event);
void addScribble(QPoint pos, unsigned int label);
void eraseScribble(QPoint pos);
void createScribbleImage();
unsigned int noScribblePixelValue();
void paintScribbles(QPixmap &dest);
void setScribblingLabel(int label);
int numLabels();
void setScribbleImageColorTable();
void postProcessDisplayPixmap(QPixmap &pixmap);
protected:
bool scribbling_;
bool erasing_;
QVector<QRgb> labelColors_;
QImage scribbleImage_;
int scribblingLabel_;
uint brushSize_;
float brushDensity_;
QAction *scribbleAct_;
QAction *clearScribbleAct_;
};
}
#endif // TVSEG_UI_SCRIBBLEIMAGEWIDGET_H