-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.h
78 lines (68 loc) · 1.67 KB
/
mainwindow.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
72
73
74
75
76
77
78
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
//#pragma execution_character_set("utf-8")//display chinese words
#include <QMainWindow>
#include <opencv2/opencv.hpp>
#include <QtWidgets/QMainWindow>
#include <QPaintEvent>
#include <QTimer>
#include <QPainter>
#include <QPixmap>
#include <QLabel>
#include <QImage>
#include <opencv.hpp>
#include <opencv2\imgproc\types_c.h>
#include <QSharedMemory>
#include "ui_mainwindow.h"
//#include "send_thread.h"
//#include "sender.h"
#include "receiver.h"
#include "send_thread.h"
//class VideoChat;
//class send_thread;
//class VideoChat;
QT_BEGIN_NAMESPACE
namespace Ui { class Chat; }
QT_END_NAMESPACE
//using namespace cv;
//extern VideoChat demo;
//std::string ip = "127.0.0.1";
extern VideoChat demo;
extern send_thread sender_thread;
//class send_thread;
class Chat : public QMainWindow
{
Q_OBJECT
public:
Chat(QWidget *parent = nullptr);
~Chat();
// void get_frame(VideoChat& demo);
// cv::Mat get_frame(VideoChat& demo);
public slots:
void updataImage();
void get_ip();
void set_frame_rate();
private:
QTimer theTimer;
cv::Mat srcImg;
cv::Mat srcImg_local;
cv::VideoCapture cap;
QLabel *ImgLabel;
// send_thread sender_thread;
Ui::Chat *ui;
std::string target_ip;
bool sender_started;
bool ready;
QSharedMemory *sharedMemory;
// VideoChat demo;
// send_thread sender_thread();
protected:
void paintEvent(QPaintEvent *e);
private slots:
// void on_checkBox_clicked();
// void on_pushButton_clicked();
void send_thread_start();
signals:
void got_ip();
};
#endif // MAINWINDOW_H