Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    Variable MID_EXPOSURE_ITERSConst

    MID_EXPOSURE_ITERS: 10

    Mid-tone iteration budget. A tone curve's shoulder is compressive, so a plain log2(target / current) step UNDER-corrects there and the error contracts only partially per iteration — the issue's own two data points bracket it (+0.97 stops → p50 0.873, −1.50 stops → p50 0.466: 2.47 stops of exposure moved log2 p50 by only ≈0.91, i.e. a display gain of ≈0.37 per stop). Hence many more iterations than the p99 pass, with an early exit once the step is negligible. Do NOT over-relax: the tone curve's log-log slope is ≤ 1 in the shoulder so a plain step never overshoots there, while over-stepping would oscillate in the linear region.

    10, not 8 — but the headroom is thin and the budget is NOT guaranteed to be enough. Swept over display bands on the simulated flat-subject profile under a Reinhard x/(1+x) curve: the 0.835-0.905 band early-exits on the 8th iteration and a narrower 0.90-0.93 band needs 9, so the margin over the measured worst case is ONE iteration. Bands starting higher still consume most or all of the budget. Under the former -6 floor, the tightest (0.99-0.999) run clamped at p50 0.586; widening the floor can only lower that outcome, so FLAT_MID_MIN remains conservative. An exhausted mid-tone budget therefore degrades gracefully into the clip/background guard instead of producing a wrong exposure. The extra screenshots are only ever spent on a flat subject.