Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Building

Layout

The crate follows the binary+library split recommended by the Rust Book: src/main.rs only parses the command line (clap) into a RunConfiguration and calls blurdetector::run; every piece of logic lives in src/lib.rs. The coding guidelines are in rules.md at the repository root.

Commands

cargo build --release   # use release builds for real runs; the pixel loops are slow in debug
cargo test              # unit tests live in the `tests` module at the bottom of src/lib.rs
cargo test area_resize_averages_pixel_blocks   # run a single test
cargo clippy            # lint (CI runs it with -D warnings on all targets)
cargo fmt               # format (CI checks with --check)

The unit tests need no test data: they exercise the image operations on synthetic pixels, notably the exact-equivalence tests that pin every fast path to its reference implementation (see Score Stability).

Test corpus

tests/assets/raw/ holds sample CR3 files for manual testing and for the golden tests. It is gitignored — the corpus lives only on development machines, and the golden tests that need it are #[ignore]d by default so cargo test stays green everywhere, including CI.

A quick manual run against the corpus:

cargo run --release -- tests/assets/raw --sort
cargo run --release -- tests/assets/raw --timing   # where does the time go?

CI

Every push runs, on rust:1.97.1:

  1. cargo fmt --check
  2. cargo clippy --all-targets -- -D warnings
  3. cargo test
  4. Release builds for Linux (x86_64-unknown-linux-gnu) and Windows (x86_64-pc-windows-gnu, cross-compiled with mingw-w64)

Tags additionally publish the binaries and a GitLab release — see Releasing.

Documentation

The book you are reading lives in docs/ and is built with mdBook:

mdbook serve docs --open   # live preview while editing
mdbook build docs          # output in docs/book/ (gitignored)

The pages CI job builds it with a pinned mdBook and deploys it to GitLab Pages on every push to the default branch.