#pragma once

#include <conio.h>
#include <chrono>
#include <iostream>
#include <sstream>
#include "Rx.LFR/LightFieldRuntime.h"
#include "Rx.LFR/ICudaData.h"
#include "Rx.LFR/CalibrationManager.h"
#include "Rx.LFR/Cuda.h"
#include "Rx.LFR/CudaCompute.h"
#include "Rx.LFR/ImageQueue.h"

#include "Rx.Core\RxException.h"
#include "Rx.CluViz.Core.CluVizTool/CvCluVizTool.h"

#include "ofThread.h"

#include "Poco/Timestamp.h"
#include "Poco/Timer.h"
#include "Poco/Stopwatch.h"

class RxProcessor : public ofThread {

public:

	RxProcessor();
	RxProcessor(unsigned int uID, Rx::LFR::CCalibration& xDefaultCalibration);
	~RxProcessor();
	void setCameraCalibration(unsigned int uID, Rx::LFR::CCalibration& xDefaultCalibration);
	int start();
	int stop();
	void threadedFunction();
	void addImage(const Rx::CRxImage& xImage);
	void totalFocusProc();
	void rawImageProc();

private:

	Rx::LFR::CCudaCompute xCudaCompute;
	Rx::LFR::ICudaDataImages* pxImages;
	Rx::LFR::CImageQueue m_xImageBuffer;
	Rx::CRxImage xCapturedImage;
	Rx::CRxImage xOutputImage;
	
	unsigned int uID;
	int iHandle;


	bool haveCameraCal;

};
