Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkComposeRGBAImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkComposeRGBAImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2008-10-05 10:47:06 $
00007   Version:   $Revision: 1.2 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkComposeRGBAImageFilter_h
00018 #define __itkComposeRGBAImageFilter_h
00019 
00020 #include "itkNaryFunctorImageFilter.h"
00021 #include "itkRGBAPixel.h"
00022 #include "itkNumericTraitsRGBAPixel.h"
00023 
00040 namespace itk
00041 {
00042   
00043 namespace Functor {  
00044   
00045 template< class TInput >
00046 class ComposeRGBA
00047 {
00048 public:
00049   typedef RGBAPixel<TInput> OutputType;
00050   ComposeRGBA() {}
00051   ~ComposeRGBA() {}
00052   bool operator!=( const ComposeRGBA & ) const
00053     {
00054     return false;
00055     }
00056   bool operator==( const ComposeRGBA & other ) const
00057     {
00058     return !(*this != other);
00059     }
00060   inline OutputType operator()(  const std::vector< TInput > & in )
00061     {
00062     OutputType pixel;
00063     pixel.Set( in[0], in[1], in[2], in[3] );
00064     return pixel;
00065     }
00066 }; 
00067 }
00068 
00069 template <typename TInputImage, 
00070           typename TOutputImage= 
00071           Image< RGBAPixel< ITK_TYPENAME TInputImage::PixelType >,
00072                  ::itk::GetImageDimension<TInputImage>::ImageDimension > >
00073 class ITK_EXPORT ComposeRGBAImageFilter :
00074     public
00075 NaryFunctorImageFilter<TInputImage,TOutputImage, 
00076                        Functor::ComposeRGBA< ITK_TYPENAME TInputImage::PixelType >   >
00077 {
00078 public:
00080   typedef ComposeRGBAImageFilter  Self;
00081   typedef NaryFunctorImageFilter<TInputImage,TOutputImage,
00082                                  Functor::ComposeRGBA<ITK_TYPENAME TInputImage::PixelType > >  Superclass;
00083   typedef SmartPointer<Self>        Pointer;
00084   typedef SmartPointer<const Self>  ConstPointer;
00085 
00086   typedef typename Superclass::OutputImageType OutputImageType;
00087   
00089   itkNewMacro(Self);
00090 
00092   itkTypeMacro(ComposeRGBAImageFilter, NaryFunctorImageFilter);
00093 
00094 protected:
00095   ComposeRGBAImageFilter() {}
00096   virtual ~ComposeRGBAImageFilter() {}
00097 
00098 private:
00099   ComposeRGBAImageFilter(const Self&); //purposely not implemented
00100   void operator=(const Self&); //purposely not implemented
00101 
00102 
00103 };
00104 
00105 } // end namespace itk
00106 
00107 
00108 #endif
00109 

Generated at Wed Nov 5 20:54:52 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000