CoderInfo 类提供了一种方法,可以提供有关 ImageMagick 对图像格式(由魔术字符串指定)支持的信息。它可以用来提供对特定命名格式的支持(作为构造函数的参数提供),或者作为容器中的一个元素,当使用 coderInfoList() 模板函数查询格式支持时。
以下代码片段说明了如何使用 CoderInfo。
CoderInfo info("GIF");
cout < info->name() << ": (" << info->description() << ") : ";
cout << "Readable = ";
if ( info->isReadable() )
cout << "true";
else
cout << "false";
cout << ", ";
cout << "Writable = ";
if ( info->isWritable() )
cout << "true";
else
cout << "false";
cout << ", ";
cout << "Multiframe = ";
if ( info->isMultiframe() )
cout << "true";
else
cout << "false";
cout << endl;
CoderInfo 类中可用的方法如下表所示