boost::gil::static_for_each

Equivalent to std::for_each. Pairs the elements semantically

Synopsis

template<
    typename P1,
    typename Op>
[[__always_inline__]]
Op
static_for_each(
    P1& p1,
    Op op);

Description

Example: Use static_for_each to increment a planar pixel iterator

struct increment {
    template <typename Incrementable>
    void operator()(Incrementable& x) const { ++x; }
};

template <typename ColorBase>
void increment_elements(ColorBase& cb) {
    static_for_each(cb, increment());
}

uint8_t red[2], green[2], blue[2];
rgb8c_planar_ptr_t p1(red,green,blue);
rgb8c_planar_ptr_t p2=p1;
increment_elements(p1);
++p2;
assert(p1 == p2);

{

Created with MrDocs