4

Is it possible with boost::gil to read the RGB image information so that I can read the file into the correct rgbx_image_t?

With the following I have to know the type beforehand and that is not so neat.

boost::gil::rgb8_image_t im;
gil::png_read_image(m_filename, im);
4

2 に答える 2

3

any_imageランタイムのものを導入する代わりに、* _ read_and_convert_image関数ファミリーを使用することもできます(あなたの場合はpng_read_and_convert_image)

于 2011-12-25T00:27:11.167 に答える
3

試したい型のリストを作成し、 を使用しany_imageて型消去された結果を保持できます。

typedef mpl::vector<rgb8_image_t, rgb16_image_t> my_img_types;
any_image<my_img_types> runtime_image;
png_read_image("input.png", runtime_image);

ソース

于 2011-11-28T15:19:02.397 に答える