[GIL] convert image view to const image view

I originally hoped that an actual function argument of type GIL mutable image view (e.g., gray8_view_t) would be automatically promoted to a (immutable or const) view (e.g., gray8c_view_t). But my experience (with version 1.44.0) indicates otherwise. It also seems like the const_view function, which generates a (const) view from an image is not overloaded to do the same using a mutable view. Obviously, I'm just getting starting using GIL, since this sort of conversion would, I presume, be used often. I've been searching the online documentation without success. Can someone point me to the answer for this basic task? In the meantime, I'll be reading the GIL header files. Thanks.

Hi Curtis, could you please provide a small code that exhibits your
problem. I'm not quite following here. Are templates a solution?
Thanks,
Christian
On Mon, Nov 29, 2010 at 6:23 PM, Curtis Gehman
I originally hoped that an actual function argument of type GIL mutable image view (e.g., gray8_view_t) would be automatically promoted to a (immutable or const) view (e.g., gray8c_view_t). But my experience (with version 1.44.0) indicates otherwise. It also seems like the const_view function, which generates a (const) view from an image is not overloaded to do the same using a mutable view. Obviously, I'm just getting starting using GIL, since this sort of conversion would, I presume, be used often. I've been searching the online documentation without success. Can someone point me to the answer for this basic task? In the meantime, I'll be reading the GIL header files.
Thanks.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

Christian, Sorry for my unresponsiveness. I think the reason that you didn't follow me was because the question was sort of silly. I eventually realized that it's not really fair to expect the compiler to apply implicit type conversion to arguments when resolving template calls. Hope my <foreshadowing>next question</foreshadowing> has some more substance behind it. On Nov 30, 2010, at 7:53 AM, Christian Henning wrote:
Hi Curtis, could you please provide a small code that exhibits your problem. I'm not quite following here. Are templates a solution?
Thanks, Christian
On Mon, Nov 29, 2010 at 6:23 PM, Curtis Gehman
wrote: I originally hoped that an actual function argument of type GIL mutable image view (e.g., gray8_view_t) would be automatically promoted to a (immutable or const) view (e.g., gray8c_view_t). But my experience (with version 1.44.0) indicates otherwise. It also seems like the const_view function, which generates a (const) view from an image is not overloaded to do the same using a mutable view. Obviously, I'm just getting starting using GIL, since this sort of conversion would, I presume, be used often. I've been searching the online documentation without success. Can someone point me to the answer for this basic task? In the meantime, I'll be reading the GIL header files.
Thanks.
participants (2)
-
Christian Henning
-
Curtis Gehman