From 707ff7f656122d96b7cd702c3ed787428084b117 Mon Sep 17 00:00:00 2001 From: Christian Henning Date: Fri, 29 Mar 2013 21:35:10 +0000 Subject: [PATCH] Added pixel by pixel multiplication and division. [SVN r83634] --- .../numeric/pixel_numeric_operations.hpp | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/include/boost/gil/extension/numeric/pixel_numeric_operations.hpp b/include/boost/gil/extension/numeric/pixel_numeric_operations.hpp index fd602f766..f5fc7c3e5 100644 --- a/include/boost/gil/extension/numeric/pixel_numeric_operations.hpp +++ b/include/boost/gil/extension/numeric/pixel_numeric_operations.hpp @@ -85,6 +85,23 @@ struct pixel_multiplies_scalar_t { } }; +/// \ingroup PixelNumericOperations +/// \brief construct for dividing two pixels +template // models pixel value concept +struct pixel_multiply_t { + PixelR operator() (const PixelRef1& p1, + const PixelRef2& p2) const { + PixelR result; + static_transform(p1,p2,result, + channel_multiplies_t::type, + typename channel_type::type, + typename channel_type::type>()); + return result; + } +}; + /// \ingroup PixelNumericOperations /// \brief construct for dividing a pixel by a scalar template // models pixel value concept +struct pixel_divide_t { + PixelR operator() (const PixelRef1& p1, + const PixelRef2& p2) const { + PixelR result; + static_transform(p1,p2,result, + channel_divides_t::type, + typename channel_type::type, + typename channel_type::type>()); + return result; + } +}; + /// \ingroup PixelNumericOperations /// \brief construct for dividing a pixel by 2 template // models pixel concept