Boost logo

Boost Users :

Subject: Re: [Boost-users] [GIL] gray pixel iterator in generic algorithm
From: Curtis Gehman (curtis2006_at_[hidden])
Date: 2011-02-17 18:26:21


Yes. My algorithm takes image views. I'm just trying to use a const view for the source image.

Duh. All I need is for the const view is ...

typedef gray_float_image_t::const_view_t gray_float_const_view_t;

With this, the unit test for my gray opening function with an unscaled float image now compiles and works fine.

Thanks for your help.


On Feb 17, 2011, at 02:03 PM, Lubomir Bourdev <lbourdev_at_[hidden]> wrote:

>
> On Feb 17, 2011, at 2:01 PM, Lubomir Bourdev wrote:
>
> > Hi Curtis,
> >
> > A GIL image is a container of pixels. It allocates and deallocates the pixels. As such it doesn't make sense to create a container type whose elements are constant.
> > Instead of images you should try to pass to your containers image views. You can get a constant and a mutable view of a given image.
> >
>
> I meant to say, pass to your _algorithms_ image views.
>
> > If you want a constant reference to an image, you can use "const gray_float_image_t&"
> >
> > Lubomir
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net