]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/Algorithms/RGBExtractFunction.h
...
[cpPlugins.git] / lib / cpExtensions / Algorithms / RGBExtractFunction.h
index 8db169720ee77e49f5c3826e4a937235c4bef34d..9dd11b54cd79cd21d042728957b5f087107bcb91 100644 (file)
 #include <itkVector.h>
 
 namespace cpExtensions
+{
+  namespace Algorithms
   {
-    namespace Algorithms
+    /**
+     */
+    template< class O >
+    struct RGBExtractFunction
     {
-      /**
-       */
-      template< class O >
-      struct RGBExtractFunction
-      {
-        typedef RGBExtractFunction  Self;
-        typedef itk::Vector< O, 3 > TOutPixel;
-
-        template< class Tr, class Tg, class Tb >
-        TOutPixel 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 );
-          }
-
-        template< class C >
-        TOutPixel operator()( const itk::RGBPixel< C >& rgb ) const
-          {
-            return(
-              this->operator()(
-                rgb.GetRed( ), rgb.GetGreen( ), rgb.GetBlue( )
-                )
-              );
-          }
-      };
-
-    } // ecapseman
+      typedef RGBExtractFunction  Self;
+      typedef itk::Vector< O, 3 > TOutPixel;
+
+      template< class Tr, class Tg, class Tb >
+      TOutPixel 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 );
+        }
+
+      template< class C >
+      TOutPixel operator()( const itk::RGBPixel< C >& rgb ) const
+        {
+          return(
+            this->operator()(
+              rgb.GetRed( ), rgb.GetGreen( ), rgb.GetBlue( )
+              )
+            );
+        }
+    };
+
+  } // ecapseman
 
 } // ecapseman