#pragma once
#include <QThread>
#include <QDebug>
#include <opencv2/opencv.hpp>
#include <opencv2/imgproc/types_c.h>
#include "SyncQueue.h"
#include "ASyncQueue.h"
#include "common.h"
#include <QObject>
#include "alg.h"
class WorkThread : public QThread
{
        Q_OBJECT
signals:
	void display_image(cv::Mat);

public:
	WorkThread(QObject *parent = 0): QThread(parent)
	{

	}
	~WorkThread();
				
	void init();
	void start_work();
	void stop();
protected:
	void run();
public:
	SyncQueue<std::pair<std::string, cv::Mat> >* p_save_queue;
	SyncQueue<cv::Mat>* p_image_queue;
	ASyncQueue<bool>* p_result_queue;
	Alg* m_alg_ptr;
	bool b_quit;
};
