zbar::Image::Image() 接受 "Y800" 以外的哪些图像格式?

What image formats other than "Y800" does zbar::Image::Image() accept?

zbar::Image::Image() 的文档没有说明可接受的图像格式:

zbar::Image::Image ( unsigned width = 0, unsigned height = 0, const std::string & format = "", const void * data = NULL, unsigned long length = 0 ) [inline] constructor.

create a new Image with the specified parameters

由于 format 是一个字符串,而不是一个枚举,我不知道可能的值。我知道的唯一值是 zbar 附带的 scan_image.cpp 示例中的 Y800

Image image(width, height, "Y800", raw, width * height);

还有其他可能的值吗?如果我在没有 ImageMagick 支持的情况下编译它也有关系吗(我将 --without-imagemagick 传递给 ./configure)?

编辑: 我在另一个问题 an answer 中找到了另一种可能的格式:

By the Way : zbar Accepts "GREY" format too...

通过库代码挖掘,支持的 fourcc 格式取决于您需要使用的视频捕获api:

  • zbar/video/v4l1.c, Video4Linux, v4l1_formats[] 列出 GREY, HI24 (HI240), RGBP (RGB565), BGR3 (RGB24), BGR4 (RGB32), RGBO(RGB555)、YUY2(YUV422)、YUYV、UYVY、Y41P(YUV411)、422P(YUV422P)、411P(YUV411P)、YU12(YUV420P)、YUV9(YUV410P)。

  • zbar/video/vfw.c,Windows、vfw_formats[] 的视频列出了 I420、YV12、NV12、UYVY、YUY2、BGR3、BGR4、YVU9、灰色,Y800,JPEG。

肯定比你想看到的更多,这也取决于相机能提供什么。毫无疑问,您必须将其设为配置设置。