Sorry for the slow response. I simply defined the following:
typedef boost::gil::pixel
gray_float_pixel_t; typedef boost::gil::image gray_float_image_t; typedef gray_float_image_t::view_t gray_float_view_t; typedef gray_float_image_t::const_view_t gray_float_const_view_t; As Dr. Bourdev advised, I do not use with these typedefs any of the color conversion operations offered by GIL. Apparently those rely on the scaling properties of the float wrapper type.
So far, all I have done with these typedefs is ...
1. construct views using interleaved_view and pixel data pointed to by [const] float*, as illustrated near the beginning of the GIL tutorial 2. create x- and y- iterators for the views to apply row- and column-oriented algorithms?
Sorry for _my_ slow response (I was in Japan). I don't care about colour conversions, but I think that these types will convert to integral types with scaling unless you add more boilerplate. I added the following -- but it may not all have been needed; this was quite a while ago and I was new to gil. I also have some remaining conversion problems where I have to rewrite expressions to make them compile, but this may be something else. Anyway, I'd really like to see native gil support for a complete set of NON-scaling types.
namespace boost { namespace gil {
/*
* Define a type that's a pure float, without scaling into [0, 1]
*/
typedef float bits32f_noscale;
GIL_DEFINE_BASE_TYPEDEFS(32f_noscale, gray)
GIL_DEFINE_ALL_TYPEDEFS_INTERNAL(32f_noscale, dev2n, devicen_t<2>, devicen_layout_t<2>)
template<> struct channel_multiplier