Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83634 - trunk/boost/gil/extension/numeric
From: chhenning_at_[hidden]
Date: 2013-03-29 17:35:10


Author: chhenning
Date: 2013-03-29 17:35:10 EDT (Fri, 29 Mar 2013)
New Revision: 83634
URL: http://svn.boost.org/trac/boost/changeset/83634

Log:
Added pixel by pixel multiplication and division.
Text files modified:
   trunk/boost/gil/extension/numeric/pixel_numeric_operations.hpp | 34 ++++++++++++++++++++++++++++++++++
   1 files changed, 34 insertions(+), 0 deletions(-)

Modified: trunk/boost/gil/extension/numeric/pixel_numeric_operations.hpp
==============================================================================
--- trunk/boost/gil/extension/numeric/pixel_numeric_operations.hpp (original)
+++ trunk/boost/gil/extension/numeric/pixel_numeric_operations.hpp 2013-03-29 17:35:10 EDT (Fri, 29 Mar 2013)
@@ -86,6 +86,23 @@
 };
 
 /// \ingroup PixelNumericOperations
+/// \brief construct for dividing two pixels
+template <typename PixelRef1, // models pixel concept
+ typename PixelRef2, // models pixel concept
+ typename PixelR> // 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<typename channel_type<PixelRef1>::type,
+ typename channel_type<PixelRef2>::type,
+ typename channel_type<PixelR>::type>());
+ return result;
+ }
+};
+
+/// \ingroup PixelNumericOperations
 /// \brief construct for dividing a pixel by a scalar
 template <typename PixelRef, // models pixel concept
           typename Scalar, // models a scalar type
@@ -103,6 +120,23 @@
 };
 
 /// \ingroup PixelNumericOperations
+/// \brief construct for dividing two pixels
+template <typename PixelRef1, // models pixel concept
+ typename PixelRef2, // models pixel concept
+ typename PixelR> // 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<typename channel_type<PixelRef1>::type,
+ typename channel_type<PixelRef2>::type,
+ typename channel_type<PixelR>::type>());
+ return result;
+ }
+};
+
+/// \ingroup PixelNumericOperations
 /// \brief construct for dividing a pixel by 2
 template <typename PixelRef> // models pixel concept
 struct pixel_halves_t {


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk