}
-static void frame_complete(void) {
+static void frame_complete(unsigned call_no) {
++frame;
if (snapshot_prefix || compare_prefix) {
Image::Image *ref = NULL;
if (compare_prefix) {
char filename[PATH_MAX];
- snprintf(filename, sizeof filename, "%s%04u.png", compare_prefix, frame);
+ snprintf(filename, sizeof filename, "%s%010u.png", compare_prefix, call_no);
ref = Image::readPNG(filename);
if (!ref) {
return;
if (snapshot_prefix) {
char filename[PATH_MAX];
- snprintf(filename, sizeof filename, "%s%04u.png", snapshot_prefix, frame);
+ 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 << "Frame " << frame << " average precision of " << src.compare(*ref) << " bits\n";
+ std::cout << "Snapshot " << call_no << " average precision of " << src.compare(*ref) << " bits\n";
delete ref;
}
}
-
- ws->processEvents();
+
}
std::cout << *call;
std::cout.flush();
};
- frame_complete();
+ frame_complete(call->no);
if (double_buffer)
drawable->swapBuffers();
else
name == "wglMakeCurrent") {
glFlush();
if (!double_buffer) {
- frame_complete();
+ frame_complete(call->no);
}
} else {
continue;
if (name == "glFlush") {
glFlush();
if (!double_buffer) {
- frame_complete();
+ frame_complete(call->no);
}
}
help="output filename [stdout]")
optparser.add_option(
'--start', metavar='FRAME',
- type="int", dest="start", default=1,
+ type="int", dest="start", default=0,
help="start frame [default: %default]")
optparser.add_option(
'--stop', metavar='FRAME',
- type="int", dest="stop", default=9999,
+ type="int", dest="stop", default=0xffffffff,
help="stop frame [default: %default]")
optparser.add_option(
'-f', '--fuzz',
html.write(' <body>\n')
html.write(' <table border="1">\n')
html.write(' <tr><th>ref</th><th>src</th><th>Δ</th></tr>\n')
- for frame_no in range(options.start, options.stop + 1):
- ref_image = "%s%04u.png" % (ref_prefix, frame_no)
- src_image = "%s%04u.png" % (src_prefix, frame_no)
- delta_image = "%s%04u_diff.png" % (src_prefix, frame_no)
+ frame_no = options.start
+ while frame_no <= options.stop:
+ ref_image = "%s%010u.png" % (ref_prefix, frame_no)
+ src_image = "%s%010u.png" % (src_prefix, frame_no)
+ delta_image = "%s%010u_diff.png" % (src_prefix, frame_no)
if os.path.exists(ref_image) and os.path.exists(src_image):
html.write(' <tr>\n')
subprocess.call(["compare", '-metric', 'AE', '-fuzz', options.fuzz, ref_image, src_image, delta_image])
surface(html, delta_image)
html.write(' </tr>\n')
html.flush()
+ frame_no += 1
html.write(' </table>\n')
html.write(' </body>\n')
html.write('</html>\n')