1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
//! Re-exports of metric crate types for convenience.
//!
//! This module provides a single place to import common types from the metrics
//! crates (dssim-core, butteraugli, ssimulacra2, fast-ssim2), allowing zen*
//! projects to depend only on codec-eval instead of each metric crate separately.
//!
//! # Example
//!
//! ```rust
//! use codec_eval::metrics::prelude::*;
//!
//! // Now you have access to:
//! // - Dssim, DssimImage (from dssim-core)
//! // - butteraugli, ButteraugliParams (from butteraugli)
//! // - compute_frame_ssimulacra2, Xyb (from ssimulacra2)
//! // - Ssimulacra2 (from fast-ssim2)
//! // - ImgRef, ImgVec (from imgref)
//! // - RGB8, RGBA8, RGB16, RGBA16 (from rgb)
//! ```
//!
//! # Note
//!
//! This is a convenience module. You can still depend on the individual metric
//! crates directly if you prefer. This module just provides a single dependency
//! point with consistent versions.
// ============================================================================
// DSSIM (Structural Similarity)
// ============================================================================
/// DSSIM metric calculator (from dssim-core).
///
/// Used for computing structural dissimilarity between images.
pub use Dssim;
/// DSSIM image wrapper (from dssim-core).
///
/// Wrap your images in this type before passing to Dssim::compare.
pub use DssimImage;
/// SSIM heatmap (from dssim-core).
///
/// Returned by Dssim::compare as the second element of the tuple.
pub use SsimMap;
// ============================================================================
// Butteraugli (Perceptual Quality)
// ============================================================================
/// Butteraugli metric function (from butteraugli).
///
/// Compare two images and return a perceptual quality score.
/// Scores < 1.0 indicate imperceptible difference.
pub use butteraugli;
/// Butteraugli parameters (from butteraugli).
///
/// Configure intensity target, HF asymmetry, and other parameters.
pub use ButteraugliParams;
/// Butteraugli result (from butteraugli).
///
/// Contains the overall score and optional diffmap.
pub use ButteraugliResult;
// ============================================================================
// SSIMULACRA2 (Best Correlation with Human Perception)
// ============================================================================
/// Compute SSIMULACRA2 score with SIMD acceleration (from fast-ssim2).
///
/// This is the recommended SSIMULACRA2 implementation, providing significantly
/// better performance than the reference implementation while producing
/// identical results.
pub use compute_ssimulacra2;
/// SSIMULACRA2 configuration for customizing computation (from fast-ssim2).
pub use Ssimulacra2Config;
/// Precomputed reference for repeated comparisons (from fast-ssim2).
///
/// Use this when comparing multiple distorted images against the same reference
/// to avoid recomputing the reference image's analysis.
pub use Ssimulacra2Reference;
// ============================================================================
// Image Types (imgref, rgb)
// ============================================================================
/// Image reference type (from imgref).
///
/// Zero-copy view into an image buffer.
pub use ImgRef;
/// Owned image type (from imgref).
///
/// Owns its pixel buffer.
pub use ImgVec;
/// RGB pixel type with u8 components (from rgb).
pub use RGB8;
/// RGBA pixel type with u8 components (from rgb).
pub use RGBA8;
/// RGB pixel type with u16 components (from rgb).
pub use RGB16;
/// RGBA pixel type with u16 components (from rgb).
pub use RGBA16;
/// Generic RGB pixel type (from rgb).
pub use RGB;
/// Generic RGBA pixel type (from rgb).
pub use RGBA;