如何使用ImageMagick在图像中简单显示
How to simply display in image with ImageMagick?
我用ImageMagick创建了一个图像。我在C++工作:
int height = xxx;
int width = xxx;
uchar* raw = xxxx; // data from somewhere else
format = "Y800";
Image myImage(width, height, format, raw, width*height);
我只想以一种非常简单的方式将图像可视化到屏幕上,以确保原始数据得到正确应用。我该怎么做?
[是的,我有RTFM。如果我想显示图像文件,我所能找到的就是如何在shell中完成它]
我混淆了Zbar::Image和Magick::Image。
Zbar::Image myZbarImage(width, height, format, raw, width*height);
是Zbar::Image的构造函数,它与Magick::Image不直接兼容,后者有其构造函数手册。然后,我可以使用display()
功能轻松显示:
Magick::Image myMagickImage; // fill
myMagickImage.display();
相关文章:
- 比较并显示使用最小值(a,b)和最大值(a、b)升序排列的4个数字
- C++,OpenCV,尝试显示图像时"OpenCV(4.3.0) Error: Assertion failed (size.width>0 && size.height>0)"此错误
- 在c++中用vector填充一个简单的动态数组
- (C++)分析树以计算返回错误值的简单算术表达式
- 字符串-C++后显示的随机字符
- 显示错误输出的简单数组排序程序
- 当简单捕获中的标识符显示为参数的声明符 ID 时,没有编译器诊断
- 简单树插入节点函数显示为空
- VS Code 上的简单 GDB C++调试失败,并显示 NullReferenceException
- 制作简单的CLI C 程序所需的知识,该程序为歌曲找到歌词并将其显示给用户
- 简单 VBO 不显示
- 简单的程序可以判断数字是偶数还是奇数,负片都显示为偶数
- 如何使用ImageMagick在图像中简单显示
- 菜单栏未显示简单的QMainWindow代码,Qt Creator Mac OS
- 为什么最简单的循环加法在控制台中显示得这么慢
- 在c++ Qt中显示2d矢量/2d数组到简单的图形
- 在wxWidgets的简单openGL显示循环中不完整的场景重绘
- "Access violation" 显示简单 Oracle 查询字符串时出错 (VS10 Exp C++)
- 简单的库,用于在 Linux 上以C++显示 2D 图像
- 在Qt5中显示FFmpeg帧的最佳/最简单的方法