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

	Program:		Range Imaging Toolkit (RITK)
	Module:			ritkCudaInstantiations.cxx
	Version:		$Revision: 3136 $
	Date:			$Date: 2012-04-19 14:42:59 +0200 (Do, 19 Apr 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 "ritkOpenGLVolumeRayCastEntity.txx"
#include "ritkRayCasterBase.txx"

#include <itkVector.h>
#include <itkRGBAPixel.h>

#include "ritkCudaImportImageContainer.txx"
#include "ritkCudaRegularMemoryImportImageContainer.txx"
#include "ritkCudaPitchedMemoryImportImageContainer.txx"
#include "ritkCudaArrayImportImageContainer.txx"
#include "ritkCuda3DArrayImportImageContainer.txx"
#include "ritkCuda3DPitchedMemoryImportImageContainer.txx"
#include "ritkCudaMemoryPool.txx"

#include "ritkTruncatedSignedDistanceFunction.h"


namespace ritk
{

// Note: CudaImportImageContainer base classes should automatically be instantiated by subclasses due to the first include

// CudaRegularMemoryImportImageContainer
template class CUDA_EXPORT CudaRegularMemoryImportImageContainer<unsigned long, unsigned char>;
template class CUDA_EXPORT CudaRegularMemoryImportImageContainer<unsigned long, itk::Vector<unsigned char,3> >;
template class CUDA_EXPORT CudaRegularMemoryImportImageContainer<unsigned long, itk::RGBAPixel<unsigned char> >;
template class CUDA_EXPORT CudaRegularMemoryImportImageContainer<unsigned long, float>;
template class CUDA_EXPORT CudaRegularMemoryImportImageContainer<unsigned long, itk::Vector<float,2> >;
template class CUDA_EXPORT CudaRegularMemoryImportImageContainer<unsigned long, itk::Vector<float,3> >;
template class CUDA_EXPORT CudaRegularMemoryImportImageContainer<unsigned long, itk::Vector<float,4> >;
template class CUDA_EXPORT CudaRegularMemoryImportImageContainer<unsigned long, itk::RGBAPixel<float> >;
template class CUDA_EXPORT CudaRegularMemoryImportImageContainer<unsigned long, unsigned int>;

// CudaPitchedMemoryImportImageContainer
template class CUDA_EXPORT CudaPitchedMemoryImportImageContainer<unsigned long, unsigned char>;
template class CUDA_EXPORT CudaPitchedMemoryImportImageContainer<unsigned long, itk::Vector<unsigned char,3> >;
template class CUDA_EXPORT CudaPitchedMemoryImportImageContainer<unsigned long, itk::RGBAPixel<unsigned char> >;
template class CUDA_EXPORT CudaPitchedMemoryImportImageContainer<unsigned long, itk::RGBAPixel<float> >;
template class CUDA_EXPORT CudaPitchedMemoryImportImageContainer<unsigned long, float>;
template class CUDA_EXPORT CudaPitchedMemoryImportImageContainer<unsigned long, itk::Vector<float,2> >;
template class CUDA_EXPORT CudaPitchedMemoryImportImageContainer<unsigned long, itk::Vector<float,3> >;
template class CUDA_EXPORT CudaPitchedMemoryImportImageContainer<unsigned long, itk::Vector<float,4> >;
template class CUDA_EXPORT CudaPitchedMemoryImportImageContainer<unsigned long, itk::Vector<float,8> >;
template class CUDA_EXPORT CudaPitchedMemoryImportImageContainer<unsigned long, itk::Vector<float,16> >;
template class CUDA_EXPORT CudaPitchedMemoryImportImageContainer<unsigned long, unsigned int>;

// CudaArrayImportImageContainer
template class CUDA_EXPORT CudaArrayImportImageContainer<unsigned long, unsigned char>;
template class CUDA_EXPORT CudaArrayImportImageContainer<unsigned long, unsigned int>;
template class CUDA_EXPORT CudaArrayImportImageContainer<unsigned long, itk::RGBAPixel<unsigned char> >;
template class CUDA_EXPORT CudaArrayImportImageContainer<unsigned long, itk::RGBAPixel<float> >;
template class CUDA_EXPORT CudaArrayImportImageContainer<unsigned long, float>;
template class CUDA_EXPORT CudaArrayImportImageContainer<unsigned long, itk::Vector<float,2> >;
template class CUDA_EXPORT CudaArrayImportImageContainer<unsigned long, itk::Vector<float,4> >;

// Cuda3DArrayImportImageContainer
template class CUDA_EXPORT Cuda3DArrayImportImageContainer<unsigned long, unsigned char>;
template class CUDA_EXPORT Cuda3DArrayImportImageContainer<unsigned long, itk::RGBAPixel<unsigned char> >;
template class CUDA_EXPORT Cuda3DArrayImportImageContainer<unsigned long, itk::RGBAPixel<float> >;
template class CUDA_EXPORT Cuda3DArrayImportImageContainer<unsigned long, unsigned int>;
template class CUDA_EXPORT Cuda3DArrayImportImageContainer<unsigned long, float>;
template class CUDA_EXPORT Cuda3DArrayImportImageContainer<unsigned long, itk::Vector<float,2> >;
template class CUDA_EXPORT Cuda3DArrayImportImageContainer<unsigned long, itk::Vector<float,4> >;

// Cuda3DPitchedMemoryImportImageContainer
template class CUDA_EXPORT Cuda3DPitchedMemoryImportImageContainer<unsigned long, unsigned char>;
template class CUDA_EXPORT Cuda3DPitchedMemoryImportImageContainer<unsigned long, itk::RGBAPixel<unsigned char> >;
template class CUDA_EXPORT Cuda3DPitchedMemoryImportImageContainer<unsigned long, itk::RGBAPixel<float> >;
template class CUDA_EXPORT Cuda3DPitchedMemoryImportImageContainer<unsigned long, unsigned int>;
template class CUDA_EXPORT Cuda3DPitchedMemoryImportImageContainer<unsigned long, float>;
template class CUDA_EXPORT Cuda3DPitchedMemoryImportImageContainer<unsigned long, itk::Vector<float,2> >;
template class CUDA_EXPORT Cuda3DPitchedMemoryImportImageContainer<unsigned long, itk::Vector<float,4> >;

// CudaMemoryPool
template class CUDA_EXPORT CudaMemoryPool<ritk::CudaRegularMemoryImportImageContainer<unsigned long, float> >;
template class CUDA_EXPORT CudaMemoryPool<ritk::CudaRegularMemoryImportImageContainer<unsigned long, unsigned char> >;
template class CUDA_EXPORT CudaMemoryPool<ritk::CudaRegularMemoryImportImageContainer<unsigned long, itk::Vector<unsigned char,3> > >;
template class CUDA_EXPORT CudaMemoryPool<ritk::CudaRegularMemoryImportImageContainer<unsigned long, itk::RGBAPixel<unsigned char> > >;
template class CUDA_EXPORT CudaMemoryPool<ritk::CudaRegularMemoryImportImageContainer<unsigned long, itk::RGBAPixel<float> > >;
template class CUDA_EXPORT CudaMemoryPool<ritk::CudaPitchedMemoryImportImageContainer<unsigned long, float> >;
template class CUDA_EXPORT CudaMemoryPool<ritk::CudaPitchedMemoryImportImageContainer<unsigned long, unsigned char> >;
template class CUDA_EXPORT CudaMemoryPool<ritk::CudaPitchedMemoryImportImageContainer<unsigned long, itk::Vector<unsigned char,3> > >;

// CudaImage
/*template class CUDA_EXPORT CudaImage<unsigned char,2>;
template class CUDA_EXPORT CudaImage<itk::Vector<unsigned char,3>, 2>;
template class CUDA_EXPORT CudaImage<float,2>;
template class CUDA_EXPORT CudaImage<itk::Vector<float,3>, 2>;*/

// Special ray caster base and ray caster entity instantiations
template class CUDA_EXPORT RayCasterBase<TruncatedSignedDistanceFunction, RImage<float,2> >;
template class CUDA_EXPORT OpenGLVolumeRayCastEntity<TruncatedSignedDistanceFunction, RImage<float,2> >;

} // ritk

// Template specialization for channel descriptor creation and itk data types
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<itk::Vector<float,4> >(void)
{
	int e = (int)sizeof(float) * 8;
	return cudaCreateChannelDesc(e, e, e, e, cudaChannelFormatKindFloat);
}
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<itk::RGBAPixel<float> >(void)
{
	int e = (int)sizeof(float) * 8;
	return cudaCreateChannelDesc(e, e, e, e, cudaChannelFormatKindFloat);
}
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<itk::RGBAPixel<unsigned char> >(void)
{
	int e = (int)sizeof(unsigned char) * 8;
	return cudaCreateChannelDesc(e, e, e, e, cudaChannelFormatKindUnsigned);
}


