-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimage.h
42 lines (33 loc) · 890 Bytes
/
image.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
#ifndef IMAGE_H
#define IMAGE_H
#include <opencv4/opencv2/opencv.hpp> // if using opencv4
#include <QObject>
#include <QWidget>
#include <QLabel>
#define SCALING_INCREMENT .1
using namespace cv;
class image : public QLabel
{
Q_OBJECT
public:
explicit image(QWidget *parent = nullptr);
image(char* filename);
signals:
void pixelPosition(QString pos);
void pixelValue(QString val);
void imageRescale(int width, int height);
void imageZoom(QString zoom);
protected:
void mousePressEvent(QMouseEvent *ev) override;
void mouseMoveEvent(QMouseEvent *ev) override;
void wheelEvent(QWheelEvent *ev) override;
void keyPressEvent(QKeyEvent *ev) override;
public slots:
void updateRender();
private:
int imageWidth, imageHeight;
int displayWidth, displayHeight;
double zoomscale= 1;
cv::Mat render, source;
};
#endif // IMAGE_H