Files
photocraft/docs
ebosido444-ai 7ed4b9e0ef Oil Paint: round sample coordinates without the libm call
The line integral convolution takes 21 bilinear samples and 20 tangent lookups per
output pixel, and every one of those computed its coordinate with `f32::floor` or
`f32::round`. On the baseline x86-64 target both lower to library calls (`jmp floorf`
and `jmp roundf` in `rustc --emit asm`), so the filter spent most of its time in 82
call-and-return pairs per pixel.

`sample()` now truncates the coordinate it already clamped to the window, and the
tangent and bristle lookups use `round_i32`/`round_index`, which produce the same
integer for every position a tile can produce.

The output is bit-identical: six 600x400 fixtures (default, short, long, unlit, RGB
without alpha, CMYK) compare sample for sample with `cmp` and a per-channel maximum
delta of 0.0. 24 MP Oil Paint is 1.88x faster on the minimum of five alternating pairs,
measured on a contended 4-core machine; docs/oil-paint-performance.md has the numbers,
that caveat and the alternatives that were measured and rejected.
2026-10-22 16:34:07 +03:00
..
2026-10-21 21:56:26 +00:00
2026-10-12 22:41:38 -04:00