|
Boost Users : |
Subject: Re: [Boost-users] [GIL] gray pixel iterator in generic algorithm
From: Robert Lupton the Good (rhl_at_[hidden])
Date: 2010-12-23 09:22:08
Dear Lubomir,
This must be quite common (I have the same problem, wanting unscaled values, in astronomical images). It was quite a lot of work to implement all the types I needed (short, int, float, double) as unscaled types that properly convert (i.e. don't, 1234 -> 1234.0). I can share the code if you like, but I wrote it long ago when I was learning both gil and C++. Should this be easy?
It would be really nice if gil supported unscaled types out of the box.
R
> I'm performing quantitative analysis with a physically significant
> gray scale. So I don't expect to do any color conversion.
>
> On Dec 22, 2010, at 2:23 PM, Lubomir Bourdev wrote:
>
>> Hi Curtis,
>>
>> GIL's default float type is not "float" but a special float wrapper
>> to ensure that the range is 0..1
>> The built-in float has a range from -infinity to infinity and that
>> does not work well when converting a value from another channel type.
>> If you want an image with a standard float you can create it like
>> this (untested)
>>
>> typedef pixel<float,gray_layout_t> gray_float_pixel_t;
>> typedef image<gray_float_pixel_t,false> gray_float_image_t;
>> typedef gray_float_image_t::view_t gray_float_view_t;
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