Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
static_transform

Equivalent to std::transform. More...

Functions

template<typename Src , typename Dst , typename Op >
Op boost::gil::static_transform (Src &src, Dst &dst, Op op)
 
template<typename Src , typename Dst , typename Op >
Op boost::gil::static_transform (const Src &src, Dst &dst, Op op)
 
template<typename P2 , typename P3 , typename Dst , typename Op >
Op boost::gil::static_transform (P2 &p2, P3 &p3, Dst &dst, Op op)
 
template<typename P2 , typename P3 , typename Dst , typename Op >
Op boost::gil::static_transform (P2 &p2, const P3 &p3, Dst &dst, Op op)
 
template<typename P2 , typename P3 , typename Dst , typename Op >
Op boost::gil::static_transform (const P2 &p2, P3 &p3, Dst &dst, Op op)
 
template<typename P2 , typename P3 , typename Dst , typename Op >
Op boost::gil::static_transform (const P2 &p2, const P3 &p3, Dst &dst, Op op)
 

Detailed Description

Equivalent to std::transform.

Pairs the elements semantically

Example: Write a generic function that adds two pixels into a homogeneous result pixel.

template <typename Result>
struct my_plus {
template <typename T1, typename T2>
Result operator()(T1 f1, T2 f2) const { return f1+f2; }
};
template <typename Pixel1, typename Pixel2, typename Pixel3>
void sum_channels(const Pixel1& p1, const Pixel2& p2, Pixel3& result) {
typedef typename channel_type<Pixel3>::type result_channel_t;
static_transform(p1,p2,result,my_plus<result_channel_t>());
}
rgb8_pixel_t p1(1,2,3);
bgr8_pixel_t p2(3,2,1);
sum_channels(p1,p2,result);
assert(result == rgb8_pixel_t(2,4,6));

Function Documentation

template<typename Src , typename Dst , typename Op >
Op boost::gil::static_transform ( Src &  src,
Dst &  dst,
Op  op 
)
inline
template<typename Src , typename Dst , typename Op >
Op boost::gil::static_transform ( const Src &  src,
Dst &  dst,
Op  op 
)
inline
template<typename P2 , typename P3 , typename Dst , typename Op >
Op boost::gil::static_transform ( P2 &  p2,
P3 &  p3,
Dst &  dst,
Op  op 
)
inline
template<typename P2 , typename P3 , typename Dst , typename Op >
Op boost::gil::static_transform ( P2 &  p2,
const P3 &  p3,
Dst &  dst,
Op  op 
)
inline
template<typename P2 , typename P3 , typename Dst , typename Op >
Op boost::gil::static_transform ( const P2 &  p2,
P3 &  p3,
Dst &  dst,
Op  op 
)
inline
template<typename P2 , typename P3 , typename Dst , typename Op >
Op boost::gil::static_transform ( const P2 &  p2,
const P3 &  p3,
Dst &  dst,
Op  op 
)
inline