#include <vnl/vnl_math.h>
#include <itkRGBPixel.h>
-#include <itkVector.h>
namespace cpExtensions
{
{
/**
*/
- template< class O >
+ template< class P >
struct RGBExtractFunction
{
- typedef RGBExtractFunction Self;
- typedef itk::Vector< O, 3 > TOutPixel;
+ typedef RGBExtractFunction Self;
+ typedef P TOutPixel;
+ typedef typename P::ValueType TValue;
template< class Tr, class Tg, class Tb >
- TOutPixel operator()( const Tr& r, const Tg& g, const Tb& b ) const
+ P operator()( const Tr& r, const Tg& g, const Tb& b ) const
{
- TOutPixel rgb;
- rgb[ 0 ] = O( r );
- rgb[ 1 ] = O( g );
- rgb[ 2 ] = O( b );
- return( rgb );
+ P out;
+ out[ 0 ] = TValue( r );
+ out[ 1 ] = TValue( g );
+ out[ 2 ] = TValue( b );
+ return( out );
}
template< class C >