[package]
name = "butteraugli"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
authors.workspace = true
rust-version.workspace = true
documentation = "https://docs.rs/butteraugli"
readme = "../README.md"
description = "Pure Rust implementation of Google's butteraugli perceptual image quality metric from libjxl"
keywords = ["image", "quality", "perceptual", "metric", "butteraugli"]
categories = ["multimedia::images", "algorithms", "graphics"]
exclude = [
    # Comparison outputs from local testing
    "comparison_outputs/",
    # Examples are local dev tools, not useful to crate consumers
    "examples/",
    # Tests that require jpegli-internals-sys (cpp-parity feature, not on crates.io)
    "tests/cpp_parity.rs",
    "tests/cpp_fuzz.rs",
    "tests/intermediate_values.rs",
    "tests/step_by_step_comparison.rs",
    "tests/reference_parity.rs",
]

[features]
default = []
# Expose internal modules for testing/benchmarking. Not a stable API.
internals = []
# Use unchecked indexing in hot loops (Malta filters) for ~6% fewer instructions.
# Safety: each function pre-validates the full access range with an assert!().
unsafe-performance = []
# cpp-parity feature only available locally (requires jpegli-internals-sys which is not published)
# Enable via: cargo test --features cpp-parity (after setting up local path in .cargo/config.toml)
# cpp-parity = ["dep:jpegli-internals-sys"]

[lints.rust]
# Allow dead code in test utilities (used by cpp-parity tests not published to crates.io)
dead_code = { level = "allow", priority = -1 }
unused_imports = { level = "allow", priority = -1 }
# cpp-parity tests check for a feature not published to crates.io
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(feature, values("cpp-parity", "avx512"))'] }

[dependencies]
wide.workspace = true
multiversion.workspace = true
multiversed.workspace = true
archmage.workspace = true
magetypes.workspace = true
imgref.workspace = true
rgb.workspace = true

# C++ butteraugli bindings for parity testing (not on crates.io)
# For local C++ parity testing, add jpegli-internals-sys to .cargo/config.toml
simd_aligned = "0.6.1"

[dev-dependencies]
# Image I/O for testing
png = "0.17"

# JPEG encoding/decoding for roundtrip tests
mozjpeg = "0.10"
jpeg-decoder = "0.3"

# Testing utilities
approx = "0.5"

# Property-based testing
proptest = "1.4"

# Date/time for reference data generation
chrono = "0.4"
