twain2/hugaotwainds/ImageMatQueue.h

46 lines
1.1 KiB
C
Raw Permalink Normal View History

2020-03-11 02:53:30 +00:00
#pragma once
#include <boost\thread\win32\mfc_thread_init.hpp>
#include <boost\thread\thread.hpp>
#include <boost\thread\mutex.hpp>
#include <opencv2\opencv.hpp>
#include "JpegBuffer.h"
#include <queue>
#include "ImageApply.h"
#include "PublicFunc.h"
#include "BlockingQueue.h"
class ImageMatQueue
{
public:
ImageMatQueue(void);
virtual ~ImageMatQueue(void);
void pushMat(JpegBuffer& data);
cv::Mat popMat();
bool empty();
bool valid();
void clear();
void setlist(std::vector<std::shared_ptr<CImageApply>> list);
void setscanflag(bool isscan);
void setduplexflag(BOOL value);
void run();
public:
int pixType;
OutHole outHole;
void setmultioutputR(bool canoutput=false);
private:
void proc();
cv::Mat _popMat();
boost::locking_queue<cv::Mat> m_images; //!< <20>Ѵ<EFBFBD><D1B4><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
boost::locking_queue<JpegBuffer> m_pImages;
boost::mutex m_Locker;
boost::mutex m_mtxJB;
boost::thread m_threadProc;
volatile bool bRun;
volatile int origin_images_remain;
bool can_multi_outputR;
volatile bool scanFlag;
volatile BOOL duplexFlag;
std::vector<std::shared_ptr<CImageApply>> m_iaList;
};