diff options
Diffstat (limited to 'boost/gil/extension/numeric/channel_numeric_operations.hpp')
-rw-r--r-- | boost/gil/extension/numeric/channel_numeric_operations.hpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/boost/gil/extension/numeric/channel_numeric_operations.hpp b/boost/gil/extension/numeric/channel_numeric_operations.hpp index d456f06eba..5356bd5738 100644 --- a/boost/gil/extension/numeric/channel_numeric_operations.hpp +++ b/boost/gil/extension/numeric/channel_numeric_operations.hpp @@ -8,7 +8,7 @@ #ifndef BOOST_GIL_EXTENSION_NUMERIC_CHANNEL_NUMERIC_OPERATIONS_HPP #define BOOST_GIL_EXTENSION_NUMERIC_CHANNEL_NUMERIC_OPERATIONS_HPP -#include <functional> +#include <boost/gil/channel.hpp> namespace boost { namespace gil { @@ -24,7 +24,7 @@ namespace boost { namespace gil { /// structure for adding one channel to another /// this is a generic implementation; user should specialize it for better performance template <typename Channel1,typename Channel2,typename ChannelR> -struct channel_plus_t : public std::binary_function<Channel1,Channel2,ChannelR> { +struct channel_plus_t { ChannelR operator()(typename channel_traits<Channel1>::const_reference ch1, typename channel_traits<Channel2>::const_reference ch2) const { return ChannelR(ch1)+ChannelR(ch2); @@ -35,7 +35,7 @@ struct channel_plus_t : public std::binary_function<Channel1,Channel2,ChannelR> /// structure for subtracting one channel from another /// this is a generic implementation; user should specialize it for better performance template <typename Channel1,typename Channel2,typename ChannelR> -struct channel_minus_t : public std::binary_function<Channel1,Channel2,ChannelR> { +struct channel_minus_t { ChannelR operator()(typename channel_traits<Channel1>::const_reference ch1, typename channel_traits<Channel2>::const_reference ch2) const { return ChannelR(ch1)-ChannelR(ch2); @@ -46,7 +46,7 @@ struct channel_minus_t : public std::binary_function<Channel1,Channel2,ChannelR> /// structure for multiplying one channel to another /// this is a generic implementation; user should specialize it for better performance template <typename Channel1,typename Channel2,typename ChannelR> -struct channel_multiplies_t : public std::binary_function<Channel1,Channel2,ChannelR> { +struct channel_multiplies_t { ChannelR operator()(typename channel_traits<Channel1>::const_reference ch1, typename channel_traits<Channel2>::const_reference ch2) const { return ChannelR(ch1)*ChannelR(ch2); @@ -57,7 +57,7 @@ struct channel_multiplies_t : public std::binary_function<Channel1,Channel2,Chan /// structure for dividing channels /// this is a generic implementation; user should specialize it for better performance template <typename Channel1,typename Channel2,typename ChannelR> -struct channel_divides_t : public std::binary_function<Channel1,Channel2,ChannelR> { +struct channel_divides_t { ChannelR operator()(typename channel_traits<Channel1>::const_reference ch1, typename channel_traits<Channel2>::const_reference ch2) const { return ChannelR(ch1)/ChannelR(ch2); @@ -68,7 +68,7 @@ struct channel_divides_t : public std::binary_function<Channel1,Channel2,Channel /// structure for adding a scalar to a channel /// this is a generic implementation; user should specialize it for better performance template <typename Channel,typename Scalar,typename ChannelR> -struct channel_plus_scalar_t : public std::binary_function<Channel,Scalar,ChannelR> { +struct channel_plus_scalar_t { ChannelR operator()(typename channel_traits<Channel>::const_reference ch, const Scalar& s) const { return ChannelR(ch)+ChannelR(s); @@ -79,7 +79,7 @@ struct channel_plus_scalar_t : public std::binary_function<Channel,Scalar,Channe /// structure for subtracting a scalar from a channel /// this is a generic implementation; user should specialize it for better performance template <typename Channel,typename Scalar,typename ChannelR> -struct channel_minus_scalar_t : public std::binary_function<Channel,Scalar,ChannelR> { +struct channel_minus_scalar_t { ChannelR operator()(typename channel_traits<Channel>::const_reference ch, const Scalar& s) const { return ChannelR(ch-s); @@ -90,7 +90,7 @@ struct channel_minus_scalar_t : public std::binary_function<Channel,Scalar,Chann /// structure for multiplying a scalar to one channel /// this is a generic implementation; user should specialize it for better performance template <typename Channel,typename Scalar,typename ChannelR> -struct channel_multiplies_scalar_t : public std::binary_function<Channel,Scalar,ChannelR> { +struct channel_multiplies_scalar_t { ChannelR operator()(typename channel_traits<Channel>::const_reference ch, const Scalar& s) const { return ChannelR(ch)*ChannelR(s); @@ -101,7 +101,7 @@ struct channel_multiplies_scalar_t : public std::binary_function<Channel,Scalar, /// structure for dividing a channel by a scalar /// this is a generic implementation; user should specialize it for better performance template <typename Channel,typename Scalar,typename ChannelR> -struct channel_divides_scalar_t : public std::binary_function<Channel,Scalar,ChannelR> { +struct channel_divides_scalar_t { ChannelR operator()(typename channel_traits<Channel>::const_reference ch, const Scalar& s) const { return ChannelR(ch)/ChannelR(s); @@ -112,7 +112,7 @@ struct channel_divides_scalar_t : public std::binary_function<Channel,Scalar,Cha /// structure for halving a channel /// this is a generic implementation; user should specialize it for better performance template <typename Channel> -struct channel_halves_t : public std::unary_function<Channel,Channel> { +struct channel_halves_t { typename channel_traits<Channel>::reference operator()(typename channel_traits<Channel>::reference ch) const { return ch/=2.0; @@ -123,7 +123,7 @@ struct channel_halves_t : public std::unary_function<Channel,Channel> { /// structure for setting a channel to zero /// this is a generic implementation; user should specialize it for better performance template <typename Channel> -struct channel_zeros_t : public std::unary_function<Channel,Channel> { +struct channel_zeros_t { typename channel_traits<Channel>::reference operator()(typename channel_traits<Channel>::reference ch) const { return ch=Channel(0); @@ -134,7 +134,7 @@ struct channel_zeros_t : public std::unary_function<Channel,Channel> { /// structure for assigning one channel to another /// this is a generic implementation; user should specialize it for better performance template <typename Channel1,typename Channel2> -struct channel_assigns_t : public std::binary_function<Channel1,Channel2,Channel2> { +struct channel_assigns_t { typename channel_traits<Channel2>::reference operator()(typename channel_traits<Channel1>::const_reference ch1, typename channel_traits<Channel2>::reference ch2) const { |