将数值二维数组保存到图像
最近,我一直在用 C 语言进行一些数值方法编程。对于错误修复和故障排除,最好能对正在发生的情况进行一些可视化表示。到目前为止,我一直将数组区域输出到标准输出,但这并没有提供那么多信息。我也一直在玩弄 gnuplot,但我无法得到它,只保存图像,而不是坐标系和所有其他东西。
所以我正在寻找一个教程或者一个库来向我展示如何将数组从 c 保存到图像中,如果能够保存到彩色图像,那就太好了。从数值到颜色的转换不是问题,我可以计算出来。如果有人能向我指出该领域一些有用的库的方向,那就太好了。
此致
Lately I have been doing some numerical method programming in C. For the bug fixing and throubleshooting it's nice to have some visual representation of what is happening. So far I have been outputting areas of array to the standard output, but that doesn't give that much information. I have also been playing around a bit with gnuplot, but I can't get it too save only image, not the coordinate system and all the other stuff.
So I am looking for a tutorial or maybe a library to show me how to save array from c into an image, it would be especially nice to be possible to save to color images. The transformation from numerical value to a color is not a problem, I can calculate that. It would just be nice of someone to point me in the direction of some useful libraries in this field.
best regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 .ppm 文件格式...它非常简单,不需要任何库...
You could use the .ppm file format... it's so simple that no library is necessary...