#ifndef CUDATEMPORALAVERAGINGRImageFILTER_H__
#define CUDATEMPORALAVERAGINGRImageFILTER_H__

#include "ritkRImage.h"
#include "ritkRGBRImage.h"
#include "ritkRImageFilterWrapper.h"
#include "CUDATemporalAveragingImageFilter.h"

/**	@class	CUDATemporalAveragingRImageFilter
 *	@author	RITKPluginCreator
 *	@brief	range wrapper class for the CUDATemporalAveragingImageFilter
 *	
 *	@details
 *	This is a range filter wrapper class for the CUDATemporalAveragingImageFilter
 *	\sa CUDATemporalAveragingImageFilter and was generated automatically by
 *	the plugin creator. Provide a detailed description of the filter here.
 *	Comment on the workflow and try to provide use cases whenever it is possible.
 */
template<class TRImage, class TRGBRImage>
class CUDATemporalAveragingRImageFilter : public ritk::RImageFilterWrapper<TRImage>
{
public:
	/** @name	Typedefs */
	//@{

	/** @name	Standard typedefs */
	//@{
	typedef CUDATemporalAveragingRImageFilter		Self;
	typedef ritk::RImageFilterWrapper<TRImage>		Superclass;
	typedef itk::SmartPointer<Self>					Pointer;
	typedef itk::SmartPointer<const Self>			ConstPointer;
	//@}

	/**	@name	Input and output typedefs */
	//@{
	typedef typename Superclass::InputImageType		InputImageType;
	typedef typename InputImageType::Pointer		InputImagePointer;
	typedef typename InputImageType::ConstPointer	InputImageConstPointer;
	typedef typename Superclass::OutputImageType	OutputImageType;
	typedef typename OutputImageType::Pointer		OutputImagePointer;
	//@}

	/**	@name	Typedefs for the RGBRImage */
	//@{
	typedef TRGBRImage								RGBRImageType;
	typedef typename RGBRImageType::Pointer			RGBRImagePointer;
	typedef typename RGBRImageType::ConstPointer	RGBRImageConstPointer;
	//@}

	//@}

	/// Object creation
	itkNewMacro(Self);

	/// RTTI
	itkTypeMacro(Self, Superclass);

	/**	@name	Set the number of frames to average */
	//@{
	void SetNumRGBDataFrames(unsigned int NumFrames);
	void SetNumRangeDataFrames(unsigned int NumFrames);
	//@}

	/** @brief	Reset the filter
	 *
	 * @details
	 *	Will reset the filter. This means that all internal images that are used to assembly the output are removed.
	 */
	void Reset();

protected:
	/// Constructor
	CUDATemporalAveragingRImageFilter();
	/// Destructor
	~CUDATemporalAveragingRImageFilter();

	/// The actual filtering. @sa RImageFilterWrapper::DoFiltering()
	void DoFiltering();

protected:
	/// The filters for different components	

	/**	@name Typedefs for the range data filter */
	//@{
	typedef CUDATemporalAveragingImageFilter<typename InputImageType::RangeImageType,typename OutputImageType::RangeImageType>  RangeFilterType;
	typedef typename RangeFilterType::Pointer RangeFilterPointer;
	RangeFilterPointer m_RangeFilter;
	//@}

	/**	@name Typedefs for the RGB data filter */
	//@{
	typedef CUDATemporalAveragingImageFilter<typename RGBRImageType::RGBImageType, typename RGBRImageType::RGBImageType, itk::Image<itk::Vector<float,3>,2> >  RGBFilterType;
	typedef typename RGBFilterType::Pointer RGBFilterPointer;
	RGBFilterPointer m_RGBFilter;
	//@}

private:
	/// purposely not implemented
	CUDATemporalAveragingRImageFilter(Self&); 
	/// purposely not implemented
	void operator=(const Self&);
};

//#include "CUDATemporalAveragingRImageFilter.txx"
typedef CUDATemporalAveragingRImageFilter<ritk::RImageF2, ritk::RGBRImageUCF2> CUDATemporalAveragingRImageFilterF2;


#endif // CUDATEMPORALAVERAGINGRImageFILTER_H__
