00001 #if !defined(__MIMASINTERNALIMAGEFUNC) 00002 # error "Do not include this file directly." 00003 #endif 00004 #if !defined(__MIMASEXTERNALIMAGEFUNC) 00005 # error "Do not include this file directly." 00006 #endif 00007 #if !defined(__MIMASFUNCTIONOBJECT) 00008 # error "Do not include this file directly." 00009 #endif 00010 00011 namespace mimas { 00012 00015 00016 template< 00017 typename T, typename T1Ptr, typename T2Ptr 00018 > 00019 image< T > __MIMASEXTERNALIMAGEFUNC( const const_image_ref< T, T1Ptr > &a, 00020 const const_image_ref< T, T2Ptr > &b ) 00021 { 00022 return image_func< T >( a, b, __MIMASFUNCTIONOBJECT< T >() ); 00023 } 00024 00026 template< 00027 typename T, typename TPtr 00028 > 00029 image< T > __MIMASEXTERNALIMAGEFUNC( const const_image_ref< T, TPtr > &a, 00030 const T &b ) 00031 { 00032 return image_func< T >( a, std::bind2nd( __MIMASFUNCTIONOBJECT< T >(), b ) ); 00033 } 00034 00036 template< 00037 typename T, typename TPtr 00038 > 00039 image< T > __MIMASEXTERNALIMAGEFUNC( const T &a, 00040 const const_image_ref< T, TPtr > &b ) 00041 { 00042 return image_func< T >( b, std::bind1st( __MIMASFUNCTIONOBJECT< T >(), a ) ); 00043 } 00044 00046 template< 00047 typename T, typename TPtr 00048 > 00049 image_ref< T > &__MIMASINTERNALIMAGEFUNC( image_ref< T > &a, 00050 const const_image_ref< T, TPtr > &b ) 00051 { 00052 return image_apply( a, a, b, 00053 _multi_help2< T, T, T, __MIMASFUNCTIONOBJECT< T > > 00054 ( __MIMASFUNCTIONOBJECT< T >() ) ); 00055 } 00056 00058 template< 00059 typename T 00060 > 00061 image_ref< T > &__MIMASINTERNALIMAGEFUNC( image_ref< T > &a, 00062 const T &b ) 00063 { 00064 return image_apply( a, a, 00065 _multi_help1< T, T, 00066 std::binder2nd< __MIMASFUNCTIONOBJECT< T > > > 00067 ( std::bind2nd( __MIMASFUNCTIONOBJECT< T >(), b ) ) ); 00068 } 00069 00071 00072 }; 00073 00074 #undef __MIMASINTERNALIMAGEFUNC 00075 #undef __MIMASEXTERNALIMAGEFUNC 00076 #undef __MIMASFUNCTIONOBJECT