#pragma once

#include <wx/glcanvas.h>
#include <wx/wx.h>
#include <boost/shared_ptr.hpp>
#include <boost/scoped_ptr.hpp>
#include <cv.h>
#include <memory>

#include "FramePipeline.h"
#include "SimpleFramePipeline.h"
#include "Capture.h"
 
using namespace boost;
using namespace std;

class OpenCVGLCanvas : public wxGLCanvas
{
private:
	shared_ptr<Capture> capture;
	auto_ptr<FramePipeline> pipeline;
	bool init;

public:
	OpenCVGLCanvas(wxWindow * parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition);
	~OpenCVGLCanvas(void);

	void OnKeyPress(wxKeyEvent & evt);

	shared_ptr<Capture> getCapture() const { return capture; }
	void setCapture(shared_ptr<Capture> val) { capture = val; }

	FramePipeline * getPipeLine() {
		return pipeline.get();
	}

	void OnPaint(wxPaintEvent& event);

	DECLARE_EVENT_TABLE()
};

