image-rs / imageproc

Image processing operations
MIT License
758 stars 149 forks source link

Switch to `image::math::Rect` #647

Closed ripytide closed 5 months ago

ripytide commented 5 months ago

Fixes #645

I moved all the current inherent methods to a RectExt helper trait since the upstream Rect doesn't have those methods, yet.

theotherphil commented 5 months ago

Thanks for the PR.

All of the draw_x functions accept inputs that may be extend outside the image and then only draw the points that are within the image bounds. This is a bit odd if you think of the image as a finite canvas but makes more sense for the original use case for several of these functions which was to annotate photos/video frames with areas of interest identified using these images.

I’d rather keep the consistency between these functions so won’t merge this PR.