#ifndef _KLTTRACKERPROCESSOR_H_
#define _KLTTRACKERPROCESSOR_H_

#include "Processor.h"
#include "KLTCornerDetector.h"
#include <QObject>

class QAction;

/**
 *	Based on the Kanade-Lucas-Tomasi tracker.
 */
class KLTTrackerProcessor : public QObject, public Processor
{
	Q_OBJECT

public:
	static const int MAX_FEATURES = 100;

public:
	KLTTrackerProcessor();
	~KLTTrackerProcessor();

	virtual void resize( int width, int height );
	virtual void process( const unsigned char* original, unsigned char* processed );
	virtual QWidget* getPropertiesWidget( QWidget* parent );
	virtual void setupToolBar( QToolBar* toolBar );

	virtual void decorateGL( Canvas* canvas );
	virtual bool onMousePress( Canvas* canvas, int x, int y );
	virtual bool onMouseRelease( Canvas* canvas, int x, int y );

private slots:
	void on_actionDetectFeatures_triggered();

private:
	int _width;
	int _height;
	KLTCornerDetector* _cornerDetector;

	QAction* _actionDetectFeatures;
};

#endif