|
|
Donner
C++20 SVG rendering library
|
Parameters for controlling image comparison tests. More...
#include "donner/svg/renderer/tests/ImageComparisonTestFixture.h"
Public Member Functions | |
| ImageComparisonParams & | disableDebugSkpOnFailure () |
| Disables saving of .skp files on test failure. | |
| ImageComparisonParams & | enableGoldenUpdateFromEnv () |
| Enables updating golden images based on an environment variable. | |
| ImageComparisonParams & | setCanvasSize (int width, int height) |
| Sets a custom canvas size for rendering. | |
Static Public Member Functions | |
| static ImageComparisonParams | Skip () |
| Creates parameters to skip a test. | |
| static ImageComparisonParams | WithThreshold (float threshold, int maxMismatchedPixels=kDefaultMismatchedPixels) |
| Creates parameters with a specific threshold and maximum mismatched pixels. | |
| static ImageComparisonParams | WithGoldenOverride (std::string_view filename) |
| Creates parameters with an overridden golden image filename. | |
Public Attributes | |
| float | threshold = kDefaultThreshold |
| Maximum allowed difference per pixel (0.0 to 1.0). | |
| int | maxMismatchedPixels = kDefaultMismatchedPixels |
| Maximum number of pixels that can exceed the threshold. | |
| bool | skip = false |
| If true, skip this test case. | |
| bool | saveDebugSkpOnFailure = true |
| If true, save a .skp file for debugging when a test fails. | |
| bool | updateGoldenFromEnv = false |
| If true, allow updating golden images via an environment variable. | |
| bool | showTerminalPreview = true |
| If true, emit a terminal preview grid when comparisons fail. | |
| std::optional< Vector2i > | canvasSize |
| Optional canvas size override, which determines the size of the rendered image. | |
| std::string_view | overrideGoldenFilename |
| Optional filename to use for the golden image, overriding the default. | |
Parameters for controlling image comparison tests.
This struct allows customization of various aspects of the image comparison process, such as error thresholds, skipping tests, and overriding golden image filenames.
|
inline |
Disables saving of .skp files on test failure.
|
inline |
Enables updating golden images based on an environment variable.
|
inline |
Sets a custom canvas size for rendering.
| width | The width of the canvas. |
| height | The height of the canvas. |
|
inlinestatic |
Creates parameters to skip a test.
|
inlinestatic |
Creates parameters with an overridden golden image filename.
| filename | The filename to use for the golden image. |
|
inlinestatic |
Creates parameters with a specific threshold and maximum mismatched pixels.
| threshold | The per-pixel difference threshold. |
| maxMismatchedPixels | The maximum number of pixels allowed to mismatch. |