Boost logo

Boost Users :

Subject: Re: [Boost-users] [GIL] color_converted_view usage problem
From: Marc-Antoine ARNAUD (mrn_at_[hidden])
Date: 2012-05-31 10:35:19


Hi Christian,

Thank for your reply, but I continued to investigate on my problem and in
fact I found the problem.
The function color_converted_view<group___image_view_transformations_color_convert.html#ga0>
only
process pixel if they are differents which is not our case, we want to
process every time.

To change that, I copy the code from GIL and modify what I wan't to process
every times (
https://github.com/tuttleofx/TuttleOFX/blob/develop/libraries/terry/src/terry/clamp.hpp),
which correct my problem.

Marc-Antoine

2012/5/30 Christian Henning <chhenning_at_[hidden]>

> Hi Marc,
>
> are you aware of scoped_channel_value? Here a small example:
>
> // Create a double channel with range [-0.5 .. 0.5]
> struct double_minus_half { static double apply() { return -0.5; } };
> struct double_plus_half { static double apply() { return 0.5; } };
> typedef scoped_channel_value<double, double_minus_half,
> double_plus_half> bits64custom_t;
>
> // channel_convert its maximum should map to the maximum
> bits64custom_t x = channel_traits<bits64custom_t>::max_value();
> assert(x == 0.5);
> bits16 y = channel_convert<bits16>(x);
> assert(y == 65535);
>
> Let me know. If that doesn't help I'll dig deeper into your problem.
>
>
> Regards,
> Christian
>
> On Tue, May 29, 2012 at 6:28 AM, Marc-Antoine ARNAUD <mrn_at_mikrosimage.eu>
> wrote:
> > Hi guys,
> >
> >
> > I currently working on TuttleOFX projet, and using Boost GIL to perform
> some
> > image process.
> > I wan't using color_converted_view to process clamping values on a view,
> > witth a specific ColorConvert (CC) functor.
> >
> > But with the actual code
> > [
> https://github.com/tuttleofx/TuttleOFX/blob/master/libraries/terry/src/terry/clamp.hpp
> ]
> > , the pixel_clamp contructor was corretly called, but our functor (void
> > operator()( const SPixel& src, DPixel& dst ) const) wasn't.
> > Does someone have the same bug ?
> > Are they more documentation anywhere on this function ( I'm refering on
> this
> > link:
> http://stlab.adobe.com/gil/html/group___image_view_transformations_color_convert.html
> )
> >
> >
> > Thanks,
> > --
> > Marc-Antoine
> >
> > _______________________________________________
> > Boost-users mailing list
> > Boost-users_at_[hidden]
> > http://lists.boost.org/mailman/listinfo.cgi/boost-users
> _______________________________________________
> 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