### Exact tone mapping: `wai.meta.gainmap`, `wai.meta.st2094_50` and `wai.media.tonemap`

- **Two companions** ([SPEC](SPEC.md) §5, §7.1): `wai.meta.gainmap` carries an ISO 21496-1:2025
  gain map (its binary metadata as written, and its gain map image as a PNG of 8-bit samples, in
  a `WGM1` frame) as a companion of an image payload; `wai.meta.st2094_50` carries SMPTE ST
  2094-50:2026-08 (Application #5) metadata sets in their Annex C encoding, each with the frames
  it applies to, in a `WD50` frame, as a companion of a video payload. Rule 2 of §7.1 gains the
  `image` media class for the gain map. Both are classified `patent-pool` (royalty status not
  established) and `standard-unclassified`. ISO 21496-1 was not read: its text is sold; what the
  extension states of it is what ST 2094-50 says of it and what public readers of its binary
  metadata implement, marked where it is used.
- **An exact rendition at a display's headroom** ([exact-tonemap](extensions/exact-tonemap.md)
  §3 to §5): `wai-tonemap:gainmap` and `wai-tonemap:st2094-50` compute the rendition from the
  base's `RGB8` samples, the companion and a headroom (an integer in 1/10000 of a stop) with a
  fixed-point `log2` (16 bits of fraction, bitwise from below) and `exp2` (sixteen Q30
  constants made by integer square roots), an sRGB table, and one rounding rule; the gain map's
  upsampling is a pinned centre-aligned bilinear; ST 2094-50's slopes come from a Q62 series for
  `tan` or from PCHIP on exact rationals; every step maps onto a formula of the standard. The
  rendition is `RGB16`, linear light relative to the display's peak, so every sink at a headroom
  presents the same bytes. Against a binary64 evaluation of the same formulas, over the corpus,
  the largest difference is 2 code values of 65535 for each derivation (§6).
- **The rendition record** (§7, §8): a sink signs, for the renditions it presented, the base, the
  companion, each headroom and each rendition's digest; a verifier holding the envelope, and the
  frames for a video, recomputes them. A rendition is a `convert` of synthesis's lattice: its
  class is the greatest of `reconstructed` and its inputs'.
- **Corpus** `live-conformance/tonemap/`, from generated HDR scenes rendered by the reference's own
  integer encoder and the `int_video` clip; its second implementation, `tonemap_verify.py`, agrees
  on every case. `png_still` reads and writes 8-bit greyscale; `staged_verify.py` knows the two
  companions' base classes.

