Enhanced rendering comparison framework for detecting visual regressions
This module provides systematic comparison tools for PNG/PDF outputs
to identify specific rendering differences between commits or versions.
= Key Features =
- Pixel-level difference analysis for raster formats
- Statistical similarity metrics (MSE, SSIM, histogram comparison)
- Visual similarity assessment using perceptual models
- Performance optimization for large image comparisons
- Comprehensive test coverage for regression detection
= Comparison Modes =
- PIXEL_DIFF: Direct pixel-by-pixel comparison
- STATISTICAL: Mean squared error and correlation analysis
- HISTOGRAM: Color distribution comparison
- PERCEPTUAL: Human-vision-weighted similarity metrics
= Usage Examples =
! Basic pixel difference
result = compare_png_images("reference.png", "current.png", PIXEL_DIFF)
! Statistical analysis with threshold
result = compare_with_threshold("ref.png", "test.png", 0.95_wp)
! Batch comparison for regression testing
call run_regression_suite("reference_dir/", "current_dir/", results)
Derived Types
Components
Type |
Visibility | Attributes |
|
Name |
| Initial | |
integer,
|
public |
|
:: |
mode |
|
|
|
Components
Type |
Visibility | Attributes |
|
Name |
| Initial | |
logical,
|
public |
|
:: |
passed |
|
|
|
character(len=512),
|
public |
|
:: |
message |
|
|
|
real(kind=wp),
|
public |
|
:: |
similarity_score |
|
|
|
real(kind=wp),
|
public |
|
:: |
mse_value |
|
|
|
real(kind=wp),
|
public |
|
:: |
ssim_value |
|
|
|
real(kind=wp),
|
public |
|
:: |
histogram_correlation |
|
|
|
integer,
|
public |
|
:: |
different_pixels |
|
|
|
integer,
|
public |
|
:: |
total_pixels |
|
|
|
type(comparison_mode_t),
|
public |
|
:: |
mode_used |
|
|
|
Functions
Arguments
Type |
Intent | Optional | Attributes |
|
Name |
|
character(len=*),
|
intent(in) |
|
|
:: |
reference_path |
|
character(len=*),
|
intent(in) |
|
|
:: |
current_path |
|
type(comparison_mode_t),
|
intent(in) |
|
|
:: |
mode |
|
Arguments
Type |
Intent | Optional | Attributes |
|
Name |
|
character(len=*),
|
intent(in) |
|
|
:: |
reference_path |
|
character(len=*),
|
intent(in) |
|
|
:: |
current_path |
|
Arguments
Type |
Intent | Optional | Attributes |
|
Name |
|
character(len=*),
|
intent(in) |
|
|
:: |
reference_path |
|
character(len=*),
|
intent(in) |
|
|
:: |
current_path |
|
real(kind=wp),
|
intent(in) |
|
|
:: |
threshold |
|
Arguments
Type |
Intent | Optional | Attributes |
|
Name |
|
character(len=*),
|
intent(in) |
|
|
:: |
reference_path |
|
character(len=*),
|
intent(in) |
|
|
:: |
current_path |
|
Arguments
Type |
Intent | Optional | Attributes |
|
Name |
|
integer,
|
intent(in) |
|
|
:: |
width |
|
integer,
|
intent(in) |
|
|
:: |
height |
|
type(comparison_mode_t),
|
intent(in) |
|
|
:: |
mode |
|
Return Value
logical
Subroutines
Arguments
Type |
Intent | Optional | Attributes |
|
Name |
|
character(len=*),
|
intent(in) |
|
|
:: |
reference_dir |
|
character(len=*),
|
intent(in) |
|
|
:: |
current_dir |
|
type(comparison_result_t),
|
intent(out), |
|
allocatable
|
:: |
results(:) |
|
Arguments
Type |
Intent | Optional | Attributes |
|
Name |
|
character(len=*),
|
intent(in) |
|
|
:: |
reference_path |
|
character(len=*),
|
intent(in) |
|
|
:: |
current_path |
|
character(len=*),
|
intent(in) |
|
|
:: |
diff_output_path |
|