Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(image_composition): image::imageops::{overlay -> replace}
* Overlay takes into account the underlying pixel and the overlayed pixel to interpolate the final pixel data. Eg: This takes effect for transparent regions in PNG images. * Replace performs the same operation for us but instead it does not perform the pixel interpolation and instead just replaces the pixel. * Test performed on 8-core i5 machine with only 1 `wl_output`: --- Benchmark 1: ./wayshot-overlay --stdout > /dev/null Time (mean ± σ): 81.6 ms ± 14.1 ms [User: 25.1 ms, System: 17.1 ms] Range (min … max): 59.0 ms … 109.8 ms 41 runs Benchmark 2: ./wayshot-replace --stdout > /dev/null Time (mean ± σ): 75.8 ms ± 14.6 ms [User: 24.7 ms, System: 15.0 ms] Range (min … max): 58.2 ms … 105.3 ms 30 runs Summary './wayshot-replace --stdout > /dev/null' ran 1.08 ± 0.28 times faster than './wayshot-overlay --stdout > /dev/null' --- Signed-off-by: Shinyzenith <[email protected]>
- Loading branch information