X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpExtensions%2FAlgorithms%2FRGBExtractFunction.h;h=ec7126b12ed720e986f30faf47f7cc0dbbb2fb4c;hb=61b3659afe961ed248f30e26f9ca8f28fcfafddc;hp=9dd11b54cd79cd21d042728957b5f087107bcb91;hpb=506b27e2ea07cb34ba230b02eb6857b20cbf78b1;p=cpPlugins.git diff --git a/lib/cpExtensions/Algorithms/RGBExtractFunction.h b/lib/cpExtensions/Algorithms/RGBExtractFunction.h index 9dd11b5..ec7126b 100644 --- a/lib/cpExtensions/Algorithms/RGBExtractFunction.h +++ b/lib/cpExtensions/Algorithms/RGBExtractFunction.h @@ -10,7 +10,6 @@ #include #include -#include namespace cpExtensions { @@ -18,20 +17,21 @@ 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 >