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

itkComposeRGBImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkComposeRGBImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2003/02/23 05:59:52 $
00007   Version:   $Revision: 1.2 $
00008 
00009   Copyright (c) 2002 Insight 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 __itkComposeRGBImageFilter_h
00018 #define __itkComposeRGBImageFilter_h
00019 
00020 #include "itkTernaryFunctorImageFilter.h"
00021 #include "itkRGBPixel.h"
00022 
00034 namespace itk
00035 {
00036   
00037 namespace Function {  
00038   
00039   template< class TInput >
00040   class ComposeRGB
00041   {
00042   public:
00043     typedef RGBPixel<TInput> OutputType;
00044     ComposeRGB() {}
00045     ~ComposeRGB() {}
00046     inline OutputType operator()(  const TInput & R, 
00047                                    const TInput & G,
00048                                    const TInput & B)
00049       {
00050         OutputType rgbPixel;
00051         rgbPixel.Set( R, G, B);
00052         return rgbPixel;
00053       }
00054     bool operator != (const ComposeRGB&) const
00055       {
00056       return false;
00057       }
00058   }; 
00059 }
00060 
00061 template <typename TInputImage, 
00062           typename TOutputImage= 
00063                      Image< RGBPixel< ITK_TYPENAME TInputImage::PixelType >,
00064                             ::itk::GetImageDimension<TInputImage>::ImageDimension > >
00065 class ITK_EXPORT ComposeRGBImageFilter :
00066     public
00067     TernaryFunctorImageFilter<TInputImage,TInputImage,
00068                       TInputImage,TOutputImage, 
00069             Function::ComposeRGB< ITK_TYPENAME TInputImage::PixelType >   >
00070 {
00071 public:
00073   typedef ComposeRGBImageFilter  Self;
00074   typedef TernaryFunctorImageFilter<TInputImage,TInputImage,
00075                       TInputImage,TOutputImage, 
00076                       Function::ComposeRGB< 
00077                       ITK_TYPENAME TInputImage::PixelType > 
00078                         >  Superclass;
00079   typedef SmartPointer<Self>   Pointer;
00080   typedef SmartPointer<const Self>  ConstPointer;
00081 
00082   typedef typename Superclass::OutputImageType OutputImageType;
00083   
00085   itkNewMacro(Self);
00086   
00087 protected:
00088   ComposeRGBImageFilter() {}
00089   virtual ~ComposeRGBImageFilter() {}
00090 
00091 private:
00092   ComposeRGBImageFilter(const Self&); //purposely not implemented
00093   void operator=(const Self&); //purposely not implemented
00094 
00095 
00096 };
00097 
00098 } // end namespace itk
00099 
00100 
00101 #endif

Generated at Fri May 21 01:14:33 2004 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000