|
Boost Users : |
Subject: Re: [Boost-users] [GIL] Black filled or not ?
From: Christian Henning (chhenning_at_[hidden])
Date: 2010-01-13 13:59:41
Please use:
fill_pixels( tmpv, comp_pixel_t( 0.f, 0.f, 0.f ));
This call wont be a memset unfortunately. But you could always just
get the char* and memset yourself.
Regards,
Christian
On Wed, Jan 13, 2010 at 11:40 AM, Eloi Du Bois <eloi.du.bois_at_[hidden]> wrote:
> I tried to do a fill_pixels, but the thing is I get an error (because I am
> doing special things) on something like this:
>
> typedef pixel<bits32f, devicen_layout_t< num_channels<View>::value >
>> comp_pixel_t;
> typedef image<comp_pixel_t, false, std::allocator<unsigned char> >
> comp_image_t;
> typedef typename view_type_from_pixel<comp_pixel_t>::type
> comp_view_t;
> typedef typename comp_view_t::x_iterator tmp_iterator;
>
> comp_image_t itmp( dst.dimensions( ) );
> comp_view_t tmpv( view( itmp ) );
> fill_pixels(tmpv, 0);
>
> But this is not working...
>
> Anyway,
> thank you
> Eloi.
>
> 2010/1/13 Christian Henning <chhenning_at_[hidden]>
>>
>> Hi Eloi, for performance reasons gil is not initializing the array
>> with a default value. Also, I wouldn't trust the compiler to do
>> anything special since it might be different from platform to
>> platform. Just call fill_pixels which in your case ( rgb32f_image_t )
>> should be reduced to a memset call.
>>
>> Regards,
>> Christian
>>
>> On Wed, Jan 13, 2010 at 7:37 AM, Eloi Du Bois <eloi.du.bois_at_[hidden]>
>> wrote:
>> > Hi all !
>> >
>> > I would like to know, when creating an image like that:
>> > rgb32f_image_t img(w, h);
>> >
>> > is the image filled with 0 by default or should I call fill_pixels ?
>> >
>> > Thank you !
>> > Eloi.
>> >
>> > _______________________________________________
>> > Boost-users mailing list
>> > Boost-users_at_[hidden]
>> > http://lists.boost.org/mailman/listinfo.cgi/boost-users
>> >
>> _______________________________________________
>> Boost-users mailing list
>> Boost-users_at_[hidden]
>> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
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