
GIL core provides channel-level equivalents for some STL algorithms, including std::fill. These have the “static_” prefix since they are compile-time recursive: rgb8_pixel_t p; static_fill(p, 10); assert(p == rgb8_pixel_t(10,10,10)); http://stlab.adobe.com/gil/html/group___color_base_algorithm_fill.html Lubomir On 1/13/10 11:24 PM, "Nicolas Lelong" <rotoglup@gmail.com> wrote: Depending on if you can rely on a boost gil extension, numeric/pixel_numeric_operations.hpp has a zero_channels function. This would give (untested) : comp_pixel_t black; zero_channels( black ); fill_pixels( tmpv, black ); Cheers, Nicolas On Wed, Jan 13, 2010 at 9:45 PM, Eloi Du Bois <eloi.du.bois@gmail.com> wrote: Okay, I see. But the problem is that I don't know the pixel number of channel. It have to be full generic. That's why I am trying this (unsuccessfully): comp_pixel_t black; color_convert( bgil::gray8_pixel_t( 0 ), black ); fill_pixels( tmpv, black);