本文整理汇总了C++中image::Image::compare方法的典型用法代码示例。如果您正苦于以下问题:C++ Image::compare方法的具体用法?C++ Image::compare怎么用?C++ Image::compare使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类image::Image
的用法示例。
在下文中一共展示了Image::compare方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: snapshot
void snapshot(unsigned call_no) {
if (!drawable ||
(!snapshot_prefix && !compare_prefix)) {
return;
}
Image::Image *ref = NULL;
if (compare_prefix) {
char filename[PATH_MAX];
snprintf(filename, sizeof filename, "%s%010u.png", compare_prefix, call_no);
ref = Image::readPNG(filename);
if (!ref) {
return;
}
if (retrace::verbosity >= 0) {
std::cout << "Read " << filename << "\n";
}
}
Image::Image *src = glstate::getDrawBufferImage(GL_RGBA);
if (!src) {
return;
}
if (snapshot_prefix) {
char filename[PATH_MAX];
snprintf(filename, sizeof filename, "%s%010u.png", snapshot_prefix, call_no);
if (src->writePNG(filename) && retrace::verbosity >= 0) {
std::cout << "Wrote " << filename << "\n";
}
}
if (ref) {
std::cout << "Snapshot " << call_no << " average precision of " << src->compare(*ref) << " bits\n";
delete ref;
}
delete src;
}