OLD | NEW |
1 """ | 1 """ |
2 Utility functions to deal with ppm (qemu screendump format) files. | 2 Utility functions to deal with ppm (qemu screendump format) files. |
3 | 3 |
4 @copyright: Red Hat 2008-2009 | 4 @copyright: Red Hat 2008-2009 |
5 """ | 5 """ |
6 | 6 |
7 import os, struct, time, re | 7 import os, struct, time, re |
8 from autotest_lib.client.bin import utils | 8 from autotest_lib.client.bin import utils |
9 | 9 |
10 # Some directory/filename utils, for consistency | 10 # Some directory/filename utils, for consistency |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 while i < width*height*3: | 228 while i < width*height*3: |
229 pixel1_str = data1[i:i+3] | 229 pixel1_str = data1[i:i+3] |
230 pixel2_str = data2[i:i+3] | 230 pixel2_str = data2[i:i+3] |
231 # Compare pixels | 231 # Compare pixels |
232 if pixel1_str == pixel2_str: | 232 if pixel1_str == pixel2_str: |
233 equal += 1.0 | 233 equal += 1.0 |
234 else: | 234 else: |
235 different += 1.0 | 235 different += 1.0 |
236 i += 3 | 236 i += 3 |
237 return equal / (equal + different) | 237 return equal / (equal + different) |
OLD | NEW |