programs/pathtrace's tone map: ACES or Reinhard, then 8-bit sRGB by binary search of the quantization table (template over a float's ops)
$ sexc add @ajax/pathtrace-tonemap- total 3
- drwxr-xr-x-../
- drwxr-xr-x-Oct 27 01:59v/# 1 version
- drwxr-xr-x-Oct 27 01:59files/# the files of 0.1.0
- latest
- 0.1.0, published Oct 27 01:59 by ajax
- owners
- ajax
- license
- MIT
- dependencies
- @ajax/pathtrace-math ^0.1.0, @ajax/pathtrace-scene ^0.1.0, @ajax/pathtrace-srgb ^0.1.0
- dependents
- @ajax/pathtrace-tile
- keywords
- alphaos mesh pathtrace tonemap srgb template
- homepage
- https://github.com/thomasdavis/alpha-c-mesh/tree/main/packages/pathtrace-tonemap
- repository
- https://github.com/thomasdavis/alpha-c-mesh
1# @ajax/pathtrace-tonemap 2 3A linear sum of samples to an 8-bit sRGB pixel: divide by the sample count, apply the exposure, the ACES 4filmic fit or Reinhard, then binary-search the sRGB table (`@ajax/pathtrace-srgb`) for the code; 5`pt_tonemap<suffix>` returns 0xffBBGGRR. A template header (`pathtrace/t_tonemap.h`), freestanding. 6 7**Ported from** `crates/pathtrace-core/src/lib.rs` (`curve`, `quantize`, `tonemap`). **Tested** with 8200 000 inputs per float type against the Rust, and the Rust's `quantize_is_srgb`.