#ifndef	CUDABILATERALIMAGEFILTERPLUGIN_H__
#define CUDABILATERALIMAGEFILTERPLUGIN_H__

#include "ritkFilterPlugin.h"

#include "RangeCUDABilateralImageFilter.h"
#include "CUDABilateralFilterWidget.h"

#include <QMutex>

/**	@class	CUDABilateralImageFilterPlugin
 *	@author	Jakob Wasza
 *	@brief	Plugin that provides a bilateral filter
 *
 *	@details
 *	This class provides a bilateral filter for range images. Filtering
 *	is ported to the graphics processing unit using CUDA.
 */
class CUDABilateralImageFilterPlugin : public ritk::FilterPlugin
{
	Q_OBJECT

public:
	/// Constructor
	CUDABilateralImageFilterPlugin();
	/// Destructor
	~CUDABilateralImageFilterPlugin();

	/// Return the name for this plugin @sa PluginBase::GetName()
	QString GetName();

	/// Return the description for this plugin
	QString GetDescription();

	/// Return the GUI for this plugin @sa PluginBase::GetPluginGUI()
	QWidget *GetPluginGUI();

public slots:
	/// Set the geometric spread parameter for range image
	void SetRangeSigmaSpatial1(float SigmaSpatial);
	/// Set the photometric spread parameter for range image
	void SetRangeSigmaRange1(float SigmaRange);
	/// Set the kernel size of the range gaussian
	void SetRangeKernelSize(int size);

	/// Set the geometric spread parameter for RGB image
	void SetRGBSigmaSpatial1(float SigmaSpatial);
	/// Set the photometric spread parameter for RGB image
	void SetRGBSigmaRange1(float SigmaRange);
	/// Set the kernel size of the RGB gaussian
	void SetRGBKernelSize(int size);

protected:
	/// Needs to be implemented: Returns the actual filter
	FilterPointer GetFilter();

	/// Interface to set a parameter with a RITKPluginConfig
	void SetParameter(QString Name, QString Value);

protected:
	/// Geometric spread for range image
	float m_RangeSigmaSpatial;
	/// Photometric spread for range image
	float m_RangeSigmaRange;

	/// Geometric spreach for RGB image
	float m_RGBSigmaSpatial;
	/// Photometric spread for RGB image
	float m_RGBSigmaRange;

	/**	@name	The actual filter */
	//@{
	typedef RangeCUDABilateralImageFilter<ritk::RImageF2> CUDABilateralFilterType;
	typedef CUDABilateralFilterType::Pointer CUDABilateralFilterPointer;
	/// The filter
	CUDABilateralFilterPointer m_Filter;
	
	//@}

	/// The widget
	CUDABilateralFilterWidget *m_Widget;
};




#endif // CUDABILATERALIMAGEFILTERPLUGIN_H__
