$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] [gil] bad_cast exception
From: Christian Henning (chhenning_at_[hidden])
Date: 2009-01-29 10:50:08
Olivier,
you can cast the any_image to any of the images you specified. Then
you can easily apply the nth_channel_view() function. Something like
this:
typedef mpl::vector< gray8_image_t
, rgb8_image_t
>::type my_img_types_t;
typedef nth_channel_view_type< rgb8_image_t::view_t >::type channel_view_t;
any_image< my_img_types_t > runtime_image;
rgb8_view_t v( view( runtime_image._dynamic_cast<rgb8_image_t>()) );
channel_view_t cv = nth_channel_view( v, 0 );
Hope that helps.
Regards,
Christian