#ifndef CUDASEPARABLENORMALIZEDCONVOLUTIONINTERFACES_H__
#define CUDASEPARABLENORMALIZEDCONVOLUTIONINTERFACES_H__

/// A plan holding the size and temporary buffers for separable normalized convolution
//----------------------------------------------------------------------------
struct SeparableNormalizedConvolutionPlan
{
public:
	/// Constructor that automatically allocates memory in accordance to the given arguments
	SeparableNormalizedConvolutionPlan(unsigned int _NX, unsigned int _NY);
	/// Destructor that does an automatic clean up
	~SeparableNormalizedConvolutionPlan();

	unsigned int NX;
	unsigned int NY;
	float *FloatMask;
	float *Buffer1;
	float *Buffer2;
	float *Buffer3;
	size_t Pitch;


protected:
	/// Purposely not implemented
	SeparableNormalizedConvolutionPlan();
};


/// Copy the kernel data to the GPU. Returns false if the kernel radius exceeds the maximum supported radius
//----------------------------------------------------------------------------
extern "C" 
bool 
SetConvolutionKernel(float *h_Kernel, int KernelRadius);


/// CUDA interface for separable normalized convolution. Returns false if the kernel radius exceeds the maximum supported radius
//----------------------------------------------------------------------------
extern "C"
bool
SeparableNormalizedConvolution(unsigned int KernelRadius, SeparableNormalizedConvolutionPlan &Plan, float *ImageDataOutput, const float *ImageDataInput, size_t ImageDataPitch, unsigned char *MaskDataOutput, const unsigned char *MaskDataInput, size_t MaskDataPitch);


#endif // CUDASEPARABLENORMALIZEDCONVOLUTIONINTERFACES_H__