Boost logo

Boost :

Subject: Re: [boost] [gil] numeric extensions pixel division.
From: Christian Henning (chhenning_at_[hidden])
Date: 2013-03-26 09:33:49


Hi!

On Tue, Mar 26, 2013 at 8:47 AM, Harg Tholan <hargtholan_at_[hidden]> wrote:
> Hey,
>
> It seems that in the numeric extensions it is implemented the division of
> channels, but not the division of pixels. Are you planning to include it at
> some point?

I'm not sure what the numeric extension has to do with division of channels?

When you say "division of pixel" do you mean the division of all
channels in a pixel?

you can do that like this:

    typedef rgb8_pixel_t pixel_t;

    pixel_t a( 10, 20, 30 );
    pixel_t b( 10, 20, 30 );

    static_for_each( a, b, [] ( channel_type< pixel_t >::type& a
                              , const channel_type< pixel_t >::type& b
                              )
        {
            a /= b;
        } );

Hope that helps,
Christian


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