Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkComposeRGBAImageFilter_h
00018 #define __itkComposeRGBAImageFilter_h
00019
00020 #include "itkNaryFunctorImageFilter.h"
00021 #include "itkRGBAPixel.h"
00022 #include "itkNumericTraitsRGBAPixel.h"
00023
00024 namespace itk
00025 {
00026
00027 namespace Functor {
00028
00029 template< class TInput >
00030 class ComposeRGBA
00031 {
00032 public:
00033 typedef RGBAPixel<TInput> OutputType;
00034 ComposeRGBA() {}
00035 ~ComposeRGBA() {}
00036 bool operator!=( const ComposeRGBA & ) const
00037 {
00038 return false;
00039 }
00040 bool operator==( const ComposeRGBA & other ) const
00041 {
00042 return !(*this != other);
00043 }
00044 inline OutputType operator()( const std::vector< TInput > & in ) const
00045 {
00046 OutputType pixel;
00047 pixel.Set( in[0], in[1], in[2], in[3] );
00048 return pixel;
00049 }
00050 };
00051 }
00052
00053
00070 template <typename TInputImage,
00071 typename TOutputImage=
00072 Image< RGBAPixel< ITK_TYPENAME TInputImage::PixelType >,
00073 ::itk::GetImageDimension<TInputImage>::ImageDimension > >
00074 class ITK_EXPORT ComposeRGBAImageFilter :
00075 public
00076 NaryFunctorImageFilter<TInputImage,TOutputImage,
00077 Functor::ComposeRGBA< ITK_TYPENAME TInputImage::PixelType > >
00078 {
00079 public:
00081 typedef ComposeRGBAImageFilter Self;
00082 typedef NaryFunctorImageFilter<TInputImage,TOutputImage,
00083 Functor::ComposeRGBA<ITK_TYPENAME TInputImage::PixelType > > Superclass;
00084 typedef SmartPointer<Self> Pointer;
00085 typedef SmartPointer<const Self> ConstPointer;
00086
00087 typedef typename Superclass::OutputImageType OutputImageType;
00088
00090 itkNewMacro(Self);
00091
00093 itkTypeMacro(ComposeRGBAImageFilter, NaryFunctorImageFilter);
00094
00095 protected:
00096 ComposeRGBAImageFilter() {}
00097 virtual ~ComposeRGBAImageFilter() {}
00098
00099 private:
00100 ComposeRGBAImageFilter(const Self&);
00101 void operator=(const Self&);
00102
00103
00104 };
00105
00106 }
00107
00108
00109 #endif
00110