You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.0 KiB
63 lines
1.0 KiB
#ifndef DATATHREAD_H |
|
#define DATATHREAD_H |
|
|
|
#include <qt_windows.h> |
|
#include <QObject> |
|
#include <QThread> |
|
#include <QByteArray> |
|
#include <QMutex> |
|
#include <opencv2/opencv.hpp> |
|
using namespace cv; |
|
class datathread : public QThread |
|
{ |
|
Q_OBJECT |
|
public: |
|
explicit datathread(QObject *parent = nullptr); |
|
|
|
void SetImageInfo(int _type, int _rows, int _cols); |
|
|
|
void stopProcess(); |
|
|
|
void setStatu(bool _run); |
|
|
|
public slots: |
|
void appendData(char* data,int len); |
|
|
|
// void slotsetid(QString ); |
|
|
|
|
|
signals: |
|
void signalGetImage(cv::Mat); |
|
void signalSetID(QString); |
|
|
|
protected: |
|
void run()override; |
|
|
|
|
|
private: |
|
QMutex dataMutex; |
|
|
|
int minLen; |
|
bool onImage; |
|
bool onLine; |
|
int cols; |
|
int rows; |
|
int type; |
|
int lineNum; |
|
int pixNum; |
|
unsigned char* recvImage; |
|
unsigned char* sendImage; |
|
int bitsPerPix; |
|
unsigned char* pureData; |
|
unsigned char* data; |
|
int datalen; |
|
|
|
bool isRun; |
|
Mat image; |
|
Mat temp; |
|
|
|
// QString id; |
|
|
|
}; |
|
|
|
#endif // DATATHREAD_H
|
|
|