Re: [Boost-users] [GIL] gray pixel iterator in generic algorithm

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
gray_float_pixel_t; typedef image gray_float_image_t; typedef gray_float_image_t::view_t gray_float_view_t;
participants (1)
-
Robert Lupton the Good