Boost logo

Boost :

Subject: Re: [boost] [gil] Pixel arithmetic operations.
From: Christian Henning (chhenning_at_[hidden])
Date: 2013-03-18 11:45:43


Hi!

On Mon, Mar 18, 2013 at 10:08 AM, Harg Tholan <hargtholan_at_[hidden]> wrote:
> Hi,
>
> Has it ever been considered to overload arithmetic operators for "pixel"?
>
> In many situations it may be useful to add, sub or divide the value of two
> or more pixels.

Think of pixels as containers of channels. And then you have a bunch
of stl like algorithms to traverse over all channels. Look here:

http://www.boost.org/doc/libs/1_53_0/libs/gil/doc/html/g_i_l_0105.html

A small code example can be found here:

http://www.boost.org/doc/libs/1_53_0/libs/gil/doc/html/g_i_l_0116.html

I hope you have lambda funtions at your disposal. ;-)

Let me know if you need something specific done.

Regards,
Christian


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk