Rev Author Line No. Line
178 kaklik 1 #if !defined(__MIMASINTERNALIMAGEFUNC)
2 # error "Do not include this file directly."
3 #endif
4 #if !defined(__MIMASEXTERNALIMAGEFUNC)
5 # error "Do not include this file directly."
6 #endif
7 #if !defined(__MIMASFUNCTIONOBJECT)
8 # error "Do not include this file directly."
9 #endif
10  
11 namespace mimas {
12  
13 /** @addtogroup arrayOp
14 @{ */
15 ///
16 template<
17 typename T, typename T1Ptr, typename T2Ptr
18 >
19 image< T > __MIMASEXTERNALIMAGEFUNC( const const_image_ref< T, T1Ptr > &a,
20 const const_image_ref< T, T2Ptr > &b )
21 {
22 return image_func< T >( a, b, __MIMASFUNCTIONOBJECT< T >() );
23 }
24  
25 ///
26 template<
27 typename T, typename TPtr
28 >
29 image< T > __MIMASEXTERNALIMAGEFUNC( const const_image_ref< T, TPtr > &a,
30 const T &b )
31 {
32 return image_func< T >( a, std::bind2nd( __MIMASFUNCTIONOBJECT< T >(), b ) );
33 }
34  
35 ///
36 template<
37 typename T, typename TPtr
38 >
39 image< T > __MIMASEXTERNALIMAGEFUNC( const T &a,
40 const const_image_ref< T, TPtr > &b )
41 {
42 return image_func< T >( b, std::bind1st( __MIMASFUNCTIONOBJECT< T >(), a ) );
43 }
44  
45 ///
46 template<
47 typename T, typename TPtr
48 >
49 image_ref< T > &__MIMASINTERNALIMAGEFUNC( image_ref< T > &a,
50 const const_image_ref< T, TPtr > &b )
51 {
52 return image_apply( a, a, b,
53 _multi_help2< T, T, T, __MIMASFUNCTIONOBJECT< T > >
54 ( __MIMASFUNCTIONOBJECT< T >() ) );
55 }
56  
57 ///
58 template<
59 typename T
60 >
61 image_ref< T > &__MIMASINTERNALIMAGEFUNC( image_ref< T > &a,
62 const T &b )
63 {
64 return image_apply( a, a,
65 _multi_help1< T, T,
66 std::binder2nd< __MIMASFUNCTIONOBJECT< T > > >
67 ( std::bind2nd( __MIMASFUNCTIONOBJECT< T >(), b ) ) );
68 }
69  
70 ///@}
71  
72 };
73  
74 #undef __MIMASINTERNALIMAGEFUNC
75 #undef __MIMASEXTERNALIMAGEFUNC
76 #undef __MIMASFUNCTIONOBJECT