
17 Oct
2006
17 Oct
'06
3:14 a.m.
I am trying to use GIL with the OpenEXR library, which uses half-precision floating-point channels: typedef image_type<half, rgb_t>::type rgb16f_image_t; typedef pixel<half, rgb_t> rgb16f_pixel_t; ... which works fine. However, I also need to convert to 8bpp integer images for use with a UI toolkit: rgb16f_image_t a(100, 100); rgb8_image_t b(100, 100); copy_pixels(const_view(a), view(b)); After providing a specialization for PixelsCompatibleConcept the code compiles fine, but I would like to provide my own code for converting channels of type "half" to type "bits8" (e.g: to convert values in the range [0, 1] to [0, 255]). Any thoughts? Tim Shead