This function creates a vtkTesting object, and specifies the name of the baseline image file, using a fully qualified path (baseline_img must be fully qualified). Then it calls the vtkTesting method which compares the image (test_img, specified only with a relative path) against th
(test_img, baseline_img, tmp_dir=".")
| 328 | # tried for a match. |
| 329 | # ============================================================================= |
| 330 | def compare_images(test_img, baseline_img, tmp_dir="."): |
| 331 | """ |
| 332 | This function creates a vtkTesting object, and specifies the name of the |
| 333 | baseline image file, using a fully qualified path (baseline_img must be |
| 334 | fully qualified). Then it calls the vtkTesting method which compares the |
| 335 | image (test_img, specified only with a relative path) against the baseline |
| 336 | image as well as any other images in the same directory as the baseline |
| 337 | image which follow the naming pattern: 'img.png', 'img_1.png', ... , 'img_N.png' |
| 338 | |
| 339 | test_img: File name of output image to be compared against baseline. |
| 340 | |
| 341 | baseline_img: Fully qualified path to first of the baseline images. |
| 342 | |
| 343 | tmp_dir: Fully qualified path to a temporary directory for storing images. |
| 344 | """ |
| 345 | |
| 346 | # Create a vtkTesting object and specify a baseline image |
| 347 | t = vtkTesting() |
| 348 | t.AddArgument("-T") |
| 349 | t.AddArgument(tmp_dir) |
| 350 | t.AddArgument("-V") |
| 351 | t.AddArgument(baseline_img) |
| 352 | |
| 353 | # Perform the image comparison test and print out the result. |
| 354 | return t.RegressionTest(test_img, 0.05) |
| 355 | |
| 356 | |
| 357 | # ============================================================================= |
no test coverage detected