/*========================================================================= Program: Insight Segmentation & Registration Toolkit Module: $RCSfile: itkComposeRGBAImageFilter.h,v $ Language: C++ Date: $Date: 2007/05/10 07:00:00 $ Version: $Revision: 1.0 $ Copyright (c) Insight Software Consortium. All rights reserved. See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef __itkComposeRGBAImageFilter_h #define __itkComposeRGBAImageFilter_h #include "itkNaryFunctorImageFilter.h" #include "itkRGBAPixel.h" #include "itkNumericTraitsRGBAPixel.h" /** \class ComposeRGBAImageFilter * \brief Implements pixel-wise composition of an RGBA pixel from four scalar images. * * This filter receives four scalar images as input. Each image containing * one of the RGBA components of a color image. The filter produces as output an * RGBA image in which the four components have been unified. The Component * type is preserved from the PixelType of the input images. * * \ingroup IntensityImageFilters */ namespace itk { namespace Functor { template< class TInput > class ComposeRGBA { public: typedef RGBAPixel OutputType; ComposeRGBA() {} ~ComposeRGBA() {} bool operator!=( const ComposeRGBA & ) const { return false; } bool operator==( const ComposeRGBA & other ) const { return !(*this != other); } inline OutputType operator()( const std::vector< TInput > & in ) { OutputType pixel; pixel.Set( in[0], in[1], in[2], in[3] ); return pixel; } }; } template , ::itk::GetImageDimension::ImageDimension > > class ITK_EXPORT ComposeRGBAImageFilter : public NaryFunctorImageFilter > { public: /** Standard class typedefs. */ typedef ComposeRGBAImageFilter Self; typedef NaryFunctorImageFilter > Superclass; typedef SmartPointer Pointer; typedef SmartPointer ConstPointer; typedef typename Superclass::OutputImageType OutputImageType; /** Method for creation through the object factory. */ itkNewMacro(Self); protected: ComposeRGBAImageFilter() {} virtual ~ComposeRGBAImageFilter() {} private: ComposeRGBAImageFilter(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace itk #endif