00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef MLN_LOGICAL_XOR_HH
00027 # define MLN_LOGICAL_XOR_HH
00028
00032
00033 # include <mln/logical/includes.hh>
00034 # include <mln/fun/vv2v/lxor.hh>
00035
00036
00037 namespace mln
00038 {
00039
00040 namespace logical
00041 {
00042
00051 template <typename L, typename R>
00052 mln_ch_fun_vv2v(lxor, L, R)
00053 xor_(const Image<L>& lhs, const Image<R>& rhs);
00054
00055
00067 template <typename L, typename R>
00068 void xor_inplace(Image<L>& lhs, const Image<R>& rhs);
00069
00070
00071 # ifndef MLN_INCLUDE_ONLY
00072
00073 template <typename L, typename R>
00074 inline
00075 mln_ch_fun_vv2v(lxor, L, R)
00076 xor_(const Image<L>& lhs, const Image<R>& rhs)
00077 {
00078 trace::entering("logical::xor_");
00079
00080 internal::tests(lhs, rhs);
00081
00082 mln_fun_vv2v(lxor, L, R) f;
00083 mln_ch_fun_vv2v(lxor, L, R) output = data::transform(lhs, rhs, f);
00084
00085 trace::exiting("logical::xor_");
00086 return output;
00087 }
00088
00089 template <typename L, typename R>
00090 inline
00091 void xor_inplace(Image<L>& lhs, const Image<R>& rhs)
00092 {
00093 trace::entering("logical::xor_inplace");
00094
00095 mlc_converts_to(mln_fun_vv2v_result(lxor, L, R),
00096 mln_value(L))::check();
00097
00098 internal::tests(lhs, rhs);
00099
00100 mln_fun_vv2v(lxor, L, R) f;
00101 data::transform_inplace(lhs, rhs, f);
00102
00103 trace::exiting("logical::xor_inplace");
00104 }
00105
00106 # endif // ! MLN_INCLUDE_ONLY
00107
00108 }
00109
00110 }
00111
00112
00113 #endif // ! MLN_LOGICAL_XOR_HH