使用 Boost.GIL 创建图像
我一直在尝试阅读 boost::gil 文档,但它介于缺乏和复杂之间。
撇开咆哮不谈,我需要一个关于如何执行以下操作的示例:
创建一个图像,例如 512x512。用红色像素填充它。写入 PNG。
在 gil 的文档中,我根本找不到任何有关执行此操作的信息。特别是创建图像或用像素部分填充图像。
如果有人可以帮忙,谢谢。
I've been trying to read the boost::gil documentation, but it's somewhere between lacking, and convoluted.
Ranting aside, I need an example on how to do the following:
Create an image of, say 512x512. Fill it with red pixels. Write to PNG.
I can't find anything about doing any of that, at all, in the documentation for gil. Particularly the creating an image or filling it with pixels part.
If anyone can help, thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我还没用过GIL,但我也想学一下。查看设计指南并用谷歌搜索与 libpng 相关的错误,看起来是最简单的示例
对我有用,在命令行上使用
-lpng
生成此图像I haven't used GIL yet, but I want to learn it as well. Having looked at the design guide and having googled up the error related to libpng, looks like the simplest example is
works for me, with
-lpng
on command line, producing this image