Boost logo

Boost Users :

Subject: Re: [Boost-users] [GIL] Raw C pointer from any_image
From: Christian Henning (chhenning_at_[hidden])
Date: 2009-01-21 17:32:35


Hi there,

the interleaved_view_get_raw_dat takes a homogeneous view but not an
any_image view. But there is a _dynamic_cast member in gil's variant
which any_image is derived from. Though, if you know what you image
type anyimage actually is you could this:

typedef boost::mpl::vector<gray8_image_t, rgb8_image_t>::type my_img_types;
any_image<my_img_types> runtime_image;

rgb8_image_t& img = runtime_image._dynamic_cast<rgb8_image_t>();

unsigned char* data = interleaved_view_get_raw_data( view( img ) );

Untest, unfortuantely. :-/

Regards,
Christian


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