import { S as SsimOptions } from './types-ClU9XBY2.js'; /** * Hitchhiker's SSIM (Structural Similarity Index) * * Reference: * A. K. Venkataramanan, C. Wu, A. C. Bovik, I. Katsavounidis, and Z. Shahid, * "A Hitchhiker's Guide to Structural Similarity," * IEEE Access, vol. 9, pp. 28872-28896, 2021. * DOI: 10.1109/ACCESS.2021.3056504 * * Reference implementation (C): https://github.com/utlive/enhanced_ssim * Licensed under BSD-2-Clause-Patent (Netflix, Inc.) * * This TypeScript implementation is independent, based on the published algorithm. * See ../../licenses/HITCHHIKERS-SSIM.md for detailed license information. * * Key improvements over standard SSIM: * 1. Uses rectangular windows instead of Gaussian windows * 2. Uses integral images (summed area tables) for O(1) window computation * 3. Uses Coefficient of Variation (CoV) pooling instead of mean pooling * 4. Self-Adaptive Scale Transform (SAST) for viewing distance adaptation * 5. Significantly faster than Gaussian-based SSIM (~4x speedup) */ /** * Hitchhiker's SSIM options */ interface HitchhikersSsimOptions extends SsimOptions { /** Dynamic range of the images (default: 255) */ L?: number; /** Window stride for non-overlapping windows (default: windowSize for non-overlapping) */ windowStride?: number; /** Use Coefficient of Variation pooling instead of mean (default: true) */ covPooling?: boolean; } /** * Compute Hitchhiker's SSIM between two images using integral images * * @param image1 - First image data (RGBA format, 4 bytes per pixel) * @param image2 - Second image data (RGBA format, 4 bytes per pixel) * @param output - Optional output buffer for SSIM map visualization (RGBA format) * @param width - Image width in pixels * @param height - Image height in pixels * @param options - SSIM computation options * @returns SSIM score (0-1, where 1 is identical) * * @example * ```typescript * // Basic usage with default CoV pooling * const score = hitchhikersSSIM(img1, img2, undefined, width, height); * * // With mean pooling (traditional) * const score = hitchhikersSSIM(img1, img2, undefined, width, height, { covPooling: false }); * ``` */ declare function hitchhikersSSIM(image1: Uint8ClampedArray | Uint8Array | Buffer, image2: Uint8ClampedArray | Uint8Array | Buffer, output: Uint8ClampedArray | Uint8Array | Buffer | undefined, width: number, height: number, options?: HitchhikersSsimOptions): number; export { type HitchhikersSsimOptions, hitchhikersSSIM as default, hitchhikersSSIM };