/*======================================================================================

	Program:		Range Imaging Toolkit (RITK)
	Module:			ritkOpenGLVolumeCudaRayCastInstantiations.cxx
	Version:		$Revision: 2745 $
	Date:			$Date: 2012-03-09 16:16:26 +0100 (Fr, 09 Mrz 2012) $

	Copyright (c) 2010-2011
	Pattern Recognition Lab, 
    University Erlangen-Nuremberg, Germany
    All rights reserved.

	This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
	See RITKCopyright.txt for more information.

	http://www5.informatik.uni-erlangen.de/research/software/ritk

========================================================================================*/


#include "ritkCuda.h"
#include "ritkCudaRayCasterInterfaces.h"
#include "ritkCudaRayCaster.txx"

#include <itkImage.h>
#include <itkRGBAPixel.h>

namespace ritk
{

// Ray caster base
template class CUDA_EXPORT CudaRayCaster<itk::Image<float,3>, itk::Image<float,2> >; 
template class CUDA_EXPORT CudaRayCaster<itk::Image<itk::RGBAPixel<unsigned char>,3>, itk::Image<itk::RGBAPixel<unsigned char>,2> >;
template class CUDA_EXPORT CudaRayCaster<itk::Image<itk::RGBAPixel<float>,3>, itk::Image<itk::RGBAPixel<float>,2> >;


} // ritk

// Template spezializations for the kernel invocation helper functions
template<> bool KernelInvocationHelper<float,float>(const ritkCudaRayCasterVolumeParameters &VP, const ritkCudaRayCasterProjectionImageParameters<float> &IP, const ritkCudaRayCasterProjectionParameters &PP)
{
	// Resolve
	return ritkFloatVolumeCudaRayCaster(VP, IP, PP);
}


// Template spezializations for the kernel invocation helper functions
template<> bool KernelInvocationHelper<itk::RGBAPixel<unsigned char>, itk::RGBAPixel<unsigned char> >(const ritkCudaRayCasterVolumeParameters &VP, const ritkCudaRayCasterProjectionImageParameters<itk::RGBAPixel<unsigned char> > &IP, const ritkCudaRayCasterProjectionParameters &PP)
{
	// Resolve
	ritkCudaRayCasterProjectionImageParameters<uchar4> RIP;
	RIP.Size = IP.Size;
	RIP.Origin = IP.Origin;
	RIP.Spacing = IP.Spacing;
	RIP.DataPtr = (uchar4*)IP.DataPtr;
	RIP.Pitch = IP.Pitch;
	
	return ritkRGBAVolumeCudaRayCaster_uchar(VP, RIP, PP);
}


// Template spezializations for the kernel invocation helper functions
template<> bool KernelInvocationHelper<itk::RGBAPixel<float>, itk::RGBAPixel<float> >(const ritkCudaRayCasterVolumeParameters &VP, const ritkCudaRayCasterProjectionImageParameters<itk::RGBAPixel<float> > &IP, const ritkCudaRayCasterProjectionParameters &PP)
{
	// Resolve
	ritkCudaRayCasterProjectionImageParameters<float4> RIP;
	RIP.Size = IP.Size;
	RIP.Origin = IP.Origin;
	RIP.Spacing = IP.Spacing;
	RIP.DataPtr = (float4*)IP.DataPtr;
	RIP.Pitch = IP.Pitch;
	
	return ritkRGBAVolumeCudaRayCaster_float(VP, RIP, PP);
}
