image-rs / imageproc

Image processing operations
MIT License
758 stars 149 forks source link

Rename `imageproc::map::map_colors()` to `map_pixels()` #631

Closed ripytide closed 5 months ago

ripytide commented 6 months ago

map_colors() is inconsistent with the rest of the mapping functions such as map_pixels() and map_subpixels(). Instead I think clearer naming would be to rename the current map_pixels() to map_enumerated_pixels() and then rename map_colors() to map_pixels().

This would then match image's pixels() and enumerate_pixels() iterators.

theotherphil commented 6 months ago

The current naming was chosen for consistency with image. I’ve just checked and the pixels() function on GenericImageView still returns an iterator over both positions and values. However, this is inconsistent with ImageBuffer::pixels(), and the ImageBuffer naming makes more sense than the GenericImageView naming so I agree with your proposed change.

theotherphil commented 5 months ago

Implemented in https://github.com/image-rs/imageproc/pull/602