From a0708b02018902497da4df6c9be05cd053374afc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Mon, 16 Sep 2013 14:59:33 +0100 Subject: [PATCH] retracediff: Dump mismtached float images to stdout. Should have an option in the future, as it will be too verbose in general. --- scripts/retracediff.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/retracediff.py b/scripts/retracediff.py index 71e9f06..18a97f6 100755 --- a/scripts/retracediff.py +++ b/scripts/retracediff.py @@ -179,6 +179,17 @@ def read_pnm(stream): return image, comment +def dumpNumpyImage(output, pixels): + height, width, channels = pixels.shape + for y in range(height): + output.write(' ') + for x in range(width): + for c in range(channels): + output.write('%0.9g,' % pixels[y, x, c]) + output.write(' ') + output.write('\n') + + def parse_env(optparser, entries): '''Translate a list of NAME=VALUE entries into an environment dictionary.''' @@ -328,6 +339,10 @@ def main(): highligher.normal() if mismatch: + if numpyImages: + dumpNumpyImage(output, refImage) + output.write("->\n") + dumpNumpyImage(output, srcImage) if options.diff_prefix and not numpyImages: prefix = os.path.join(options.diff_prefix, '%010u' % callNo) prefix_dir = os.path.dirname(prefix) -- 2.43.0