Boost logo

Boost Users :

Subject: Re: [Boost-users] [gil] bad_cast exception
From: Christian Henning (chhenning_at_[hidden])
Date: 2009-01-30 17:27:03


Sorry Olivier, I tried some stuff but haven't made much progress. It
still is riddle to me why the code compiles. Should it compile? I
don't know. Hopefully Lubomir can fill in some time.

Regards,
Christian

On Thu, Jan 29, 2009 at 12:44 PM, Olivier Tournaire <olitour_at_[hidden]> wrote:
> 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 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