2020-08-31 08:08:50 +00:00
|
|
|
|
#pragma once
|
|
|
|
|
#include <thread>
|
|
|
|
|
#include <mutex>
|
|
|
|
|
#include <opencv2\opencv.hpp>
|
|
|
|
|
#include "JpegBuffer.h"
|
2021-07-31 03:12:53 +00:00
|
|
|
|
#include <queue>
|
2020-08-31 08:08:50 +00:00
|
|
|
|
#include "PublicFunc.h"
|
2021-07-31 03:12:53 +00:00
|
|
|
|
#include "BlockingQueue.h"
|
2020-08-31 08:08:50 +00:00
|
|
|
|
|
|
|
|
|
class ImageMatQueue
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
ImageMatQueue(void);
|
|
|
|
|
virtual ~ImageMatQueue(void);
|
|
|
|
|
|
|
|
|
|
void pushMat(JpegBuffer& data);
|
2021-07-31 03:12:53 +00:00
|
|
|
|
std::string popMat(int num);
|
2020-08-31 08:08:50 +00:00
|
|
|
|
bool empty();
|
|
|
|
|
bool valid();
|
|
|
|
|
void clear();
|
|
|
|
|
void run();
|
|
|
|
|
int getMatSum();
|
2021-07-31 03:12:53 +00:00
|
|
|
|
bool isScanning();
|
|
|
|
|
void SetScanFlag(bool scannning) { bScanning = bScanning; }
|
|
|
|
|
void SetFilePath(std::string csFilePath)
|
2020-08-31 08:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
csPath = csFilePath;
|
|
|
|
|
}
|
2021-07-31 03:12:53 +00:00
|
|
|
|
|
|
|
|
|
std::string GetFilePath()
|
2020-08-31 08:08:50 +00:00
|
|
|
|
{
|
|
|
|
|
return csPath;
|
|
|
|
|
}
|
2021-07-31 03:12:53 +00:00
|
|
|
|
|
2020-08-31 08:08:50 +00:00
|
|
|
|
public:
|
|
|
|
|
int pixType;
|
|
|
|
|
void setmultioutputR(bool canoutput=false);
|
|
|
|
|
void SetDevModel(int dev=-1);
|
2021-07-31 03:12:53 +00:00
|
|
|
|
|
|
|
|
|
std::string csPath;
|
2020-08-31 08:08:50 +00:00
|
|
|
|
private:
|
|
|
|
|
void proc();
|
|
|
|
|
|
2021-07-31 03:12:53 +00:00
|
|
|
|
BlockingQueue<std::string> m_images; //!< <20>Ѵ<EFBFBD><D1B4><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2020-08-31 08:08:50 +00:00
|
|
|
|
BlockingQueue<JpegBuffer> m_pImages;
|
|
|
|
|
std::thread m_threadProc;
|
|
|
|
|
volatile bool bRun;
|
|
|
|
|
bool can_multi_outputR;
|
|
|
|
|
int DevModel;
|
2021-07-31 03:12:53 +00:00
|
|
|
|
volatile bool bScanning;
|
|
|
|
|
volatile int imageremain;
|
2020-08-31 08:08:50 +00:00
|
|
|
|
};
|
|
|
|
|
|