Boost logo

Boost Users :

Subject: Re: [Boost-users] [gil] bad_cast exception
From: Olivier Tournaire (olitour_at_[hidden])
Date: 2009-01-29 12:44:04


Christian,

Thank you for this code. However, I would like the extracted channel to be
the same pixel type as the original runtime image. I guess it is possible
since if I write the extracted channel view without storing it in a variable
(see my first post), it works fine. Here it is:

boost::gil::jpeg_read_image( input_filename , runtime_image );
boost::gil::jpeg_write_view( output_filename , boost::gil::nth_channel_view(
view(runtime_image) , channel_index ) );

I just want to be as generic as possible and avoid "if ... else if ..." to
get the right pixel type at runtime and thus perform the right dynamic_cast.
Is it possible ?

Regards,

Olivier



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