image-rs / imageproc

Image processing operations
MIT License
758 stars 149 forks source link

Add a doc-macro for mut versions of functions. #632

Closed ripytide closed 6 months ago

ripytide commented 6 months ago

As discussed in #622.

As it turned out the imageproc::map functions were the only functions not able to be de-duplicated using a doc-comment generating macro as the image bounds are completely different per function so complete separate implementations (Fn(P) -> P vs Fn(P) -> Q).

But overall I'm very happy with the amount of de-duplication achieved which should make things much more standardized and easier to maintain and extend.

I also standardized the non-mut functions being above the mut function in the source code with no empty-line between them for consistency.

theotherphil commented 6 months ago

Thanks, this is a nice simplification.