JuliaImages / ImageDraw.jl

Drawing Package for JuliaImages
Other
27 stars 17 forks source link

Why collect the indices instead of drawing directly? #78

Closed yakir12 closed 10 months ago

yakir12 commented 11 months ago

In https://github.com/JuliaImages/ImageDraw.jl/blob/8b2a4f125cdaf4031b2e72755910ee39b094fccc/src/ellipse2d.jl#L18 we collect indices to later iterate over and draw (here). Why not skip the collection and just draw right there and then inside the loop?

It would avoid dynamically allocating x and y.

If there's no reason not I can PR and benchmark.

yakir12 commented 11 months ago

I went ahead and tried it out, looks pretty promising...