14 #ifndef GIL_PIXEL_NUMERIC_OPERATIONS_HPP 15 #define GIL_PIXEL_NUMERIC_OPERATIONS_HPP 31 #include <boost/gil/gil_config.hpp> 32 #include <boost/gil/pixel.hpp> 33 #include <boost/gil/color_base_algorithm.hpp> 36 namespace boost {
namespace gil {
40 template <
typename PixelRef1,
44 PixelR operator() (
const PixelRef1& p1,
45 const PixelRef2& p2)
const {
47 static_transform(p1,p2,result,
49 typename channel_type<PixelRef2>::type,
50 typename channel_type<PixelR>::type>());
57 template <
typename PixelRef1,
61 PixelR operator() (
const PixelRef1& p1,
62 const PixelRef2& p2)
const {
64 static_transform(p1,p2,result,
66 typename channel_type<PixelRef2>::type,
67 typename channel_type<PixelR>::type>());
74 template <
typename PixelRef,
78 PixelR operator () (
const PixelRef& p,
79 const Scalar& s)
const {
81 static_transform(p,result,
84 typename channel_type<PixelR>::type>(),s));
91 template <
typename PixelRef,
95 PixelR operator () (
const PixelRef& p,
96 const Scalar& s)
const {
98 static_transform(p,result,
101 typename channel_type<PixelR>::type>(),s));
108 template <
typename PixelRef>
110 PixelRef& operator () (PixelRef& p)
const {
111 static_for_each(p,
channel_halves_t<
typename channel_type<PixelRef>::type>());
118 template <
typename PixelRef>
120 PixelRef& operator () (PixelRef& p)
const {
121 static_for_each(p,
channel_zeros_t<
typename channel_type<PixelRef>::type>());
127 template <
typename Pixel>
128 void zero_channels(Pixel& p) {
129 static_for_each(p,
channel_zeros_t<
typename channel_type<Pixel>::type>());
136 template <
typename PixelRef,
139 PixelRefR operator () (
const PixelRef& src,
140 PixelRefR& dst)
const {
142 typename channel_type<PixelRefR>::type>());
Structures for channel-wise numeric operations /.
construct for subtracting two pixels
construct for dividing a pixel by 2
construct for adding two pixels
construct for dividing a pixel by a scalar
construct for setting a pixel to zero (for whatever zero means)
construct for multiplying scalar to a pixel