1 // -------------------------------------------------------------------------
2 // @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
3 // -------------------------------------------------------------------------
5 #ifndef __CPEXTENSIONS__ALGORITHMS__RGBEXTRACTFUNCTION__H__
6 #define __CPEXTENSIONS__ALGORITHMS__RGBEXTRACTFUNCTION__H__
10 #include <vnl/vnl_math.h>
12 #include <itkRGBPixel.h>
13 #include <itkVector.h>
15 namespace cpExtensions
22 struct RGBExtractFunction
24 typedef RGBExtractFunction Self;
25 typedef itk::Vector< O, 3 > TOutPixel;
27 template< class Tr, class Tg, class Tb >
28 TOutPixel operator()( const Tr& r, const Tg& g, const Tb& b ) const
38 TOutPixel operator()( const itk::RGBPixel< C >& rgb ) const
42 rgb.GetRed( ), rgb.GetGreen( ), rgb.GetBlue( )
52 #endif // __CPEXTENSIONS__ALGORITHMS__RGBEXTRACTFUNCTION__H__