huago-corrcet_tools/HuaGoCorrect/ImageMatQueue.h

54 lines
984 B
C
Raw Permalink Normal View History

2020-08-31 08:08:50 +00:00
#pragma once
#include <thread>
#include <mutex>
#include <opencv2\opencv.hpp>
#include "JpegBuffer.h"
#include <queue>
2020-08-31 08:08:50 +00:00
#include "PublicFunc.h"
#include "BlockingQueue.h"
2020-08-31 08:08:50 +00:00
class ImageMatQueue
{
public:
ImageMatQueue(void);
virtual ~ImageMatQueue(void);
void pushMat(JpegBuffer& data);
std::string popMat(int num);
2020-08-31 08:08:50 +00:00
bool empty();
bool valid();
void clear();
void run();
int getMatSum();
bool isScanning();
void SetScanFlag(bool scannning) { bScanning = bScanning; }
void SetFilePath(std::string csFilePath)
2020-08-31 08:08:50 +00:00
{
csPath = csFilePath;
}
std::string GetFilePath()
2020-08-31 08:08:50 +00:00
{
return csPath;
}
2020-08-31 08:08:50 +00:00
public:
int pixType;
void setmultioutputR(bool canoutput=false);
void SetDevModel(int dev=-1);
std::string csPath;
2020-08-31 08:08:50 +00:00
private:
void proc();
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;
volatile bool bScanning;
volatile int imageremain;
2020-08-31 08:08:50 +00:00
};