image-rs / imageproc

Image processing operations
MIT License
755 stars 148 forks source link

Modified convex_hull fn to handle coordinates with negative values #448

Closed lazareviczoran closed 3 years ago

lazareviczoran commented 3 years ago

The convex_hull fn param -> points_slice: &[Point<T>] is a set of points, there is no specific limit (like x = {0,width} and y = {0,height} when the param is an image). Since in the original implementation I was converting it to usize it was failing when the generic type T included negative values. Actually, that conversion can be avoided by including Ord and Bounded traits to the generic type definition.

theotherphil commented 3 years ago

Thanks!