Skip to main content

Module filter

Module filter 

Source
Expand description

Small image-filter primitives, grouped here while there are too few to deserve their own crate.

Currently exposes a single typed scalar tone-mapping operator: the Reinhard 2002 simple global form Ld = L / (1 + L). The math is a published uncopyrightable fact (Reinhard et al., ACM TOG SIGGRAPH 2002), transcribed in docs/image/filter/tone-mapping-operators.md §2.2. This crate re-states the formula and pins it behind a typed wrapper so callers can’t accidentally mix scene and display luminance domains.

The operator has a closed-form inverse on Ld ∈ [0, 1) (see DisplayLuminance::to_scene below), which is what the round-trip unit test exercises. There is no implicit clamping: the caller decides whether to saturate Ld to a smaller range (e.g. for an 8-bit output).

§Why a typed scalar

The wider image-filter pipeline carries planar pixel data through other crates. The point of this module is not to be a fast batch-luminance tone-mapper — it is the operator’s reference scalar form, suitable for per-pixel use, LUT building, or unit-testing other compressors against a known-good identity round-trip.

Structs§

DisplayLuminance
Display luminance after tone-mapping: a scalar in [0, 1).
SceneLuminance
Scene (world) luminance: a non-negative scalar in arbitrary linear units.