Cub*_*bbi 24
我还没有用过GIL,但我也想学习它.看了设计指南并搜索了与libpng相关的错误,看起来最简单的例子就是
#define png_infopp_NULL (png_infopp)NULL
#define int_p_NULL (int*)NULL
#include <boost/gil/gil_all.hpp>
#include <boost/gil/extension/io/png_dynamic_io.hpp>
using namespace boost::gil;
int main()
{
rgb8_image_t img(512, 512);
rgb8_pixel_t red(255, 0, 0);
fill_pixels(view(img), red);
png_write_view("redsquare.png", const_view(img));
}
Run Code Online (Sandbox Code Playgroud)
适用于我,-lpng
在命令行上生成此图像