Compares renwin's (a vtkRenderWindow) contents with the image file whose name is given in the second argument. If the image file does not exist the image is generated and stored. If not the image in the render window is compared to that of the figure. This function also handles mul
(renwin, img_fname, threshold=0.05)
| 352 | print(output_string.get()) |
| 353 | |
| 354 | def compareImage(renwin, img_fname, threshold=0.05): |
| 355 | """Compares renwin's (a vtkRenderWindow) contents with the image |
| 356 | file whose name is given in the second argument. If the image |
| 357 | file does not exist the image is generated and stored. If not the |
| 358 | image in the render window is compared to that of the figure. |
| 359 | This function also handles multiple images and finds the best |
| 360 | matching image. """ |
| 361 | |
| 362 | global _NO_IMAGE |
| 363 | if _NO_IMAGE: |
| 364 | return |
| 365 | |
| 366 | w2if = vtkWindowToImageFilter() |
| 367 | w2if.ReadFrontBufferOff() |
| 368 | w2if.SetInput(renwin) |
| 369 | w2if.Update() |
| 370 | try: |
| 371 | compareImageWithSavedImage(w2if, img_fname, threshold) |
| 372 | except RuntimeError: |
| 373 | w2if.ReadFrontBufferOn() |
| 374 | compareImageWithSavedImage(w2if, img_fname, threshold) |
| 375 | return |
| 376 | |
| 377 | def main(cases): |
| 378 | """ Pass a list of tuples containing test classes and the starting |
no test coverage detected