Boost logo

Boost Users :

From: John Femiani (JOHN.FEMIANI_at_[hidden])
Date: 2008-04-03 17:21:02


I am used to explicitly invoking the default constructor to initialize
values to 'zero', but that does not seem to work with GIL.

 

In the following code:

 

template<class View>

void do_something(View const& img){

            typedef typename View::value_type pixel_type;

 

            pixel_type black = pixel_type();

            //I expect zero, I guess this may not always be black...

 

            //.....

}

 

 

The value held in 'black' turns out to be 205 (I think it is acting like
uninitialized stack data).

 

Is this the intended behavior? I have a slew of code that used to work
this way and somehow now it does not - did this behavior change
recently?

 

In the meantime I just made a struct named black with a typecast
operator enabled for gil pixels.

 

-- John

 



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