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: 2009-02-24 19:03:15 $
00007   Version:   $Revision: 1.4 $
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 
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&); //purposely not implemented
00101   void operator=(const Self&); //purposely not implemented
00102 
00103 
00104 };
00105 
00106 } // end namespace itk
00107 
00108 
00109 #endif
00110 

Generated at Tue Sep 15 02:36:12 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000