image-rs / imageproc

Image processing operations
MIT License
758 stars 149 forks source link

`warp_inner()` and `equalize_histogram_mut()` should be two functions based on `rayon` feature #625

Open ripytide opened 6 months ago

ripytide commented 6 months ago

Cargo features are meant to be additive not mutually exclusive, warp_inner() and all functions that call this function break this additive rule. This could cause unintended behavior as a user won't be able to know which version (parallel vs single-threaded) version was being called due to cargo feature unification. It also means they could never have both the parallel and non-parallel version running in the same application.

To resolve this I suggest duplicating the functions' names to create single-threaded and multi-threaded variants with _parallel() appended. To simplify documentation I suggest the _parallel() versions simply have doc links to the non-parallel versions since duplicating the documentation runs the risk of the two copies of documentation getting out of sync.

ripytide commented 6 months ago

This also applies to equalize_histogram_mut() as well.