ShaharMS / Vision

Cross framework, cross platform computer vision for Haxe
MIT License
35 stars 5 forks source link

Rounded shapes (I might need help with it… WIP) #36

Closed Wither362 closed 1 week ago

Wither362 commented 1 year ago

TODO:

ShaharMS commented 1 year ago

This looks interesting, I already need to redesign image views to work with arbitrary shapes & functions. This might need to wait though, since this stuff is performance critical (image views are taken into account each time you manipulate a pixel)

Wither362 commented 1 year ago

This looks interesting, I already need to redesign image views to work with arbitrary shapes & functions. This might need to wait though, since this stuff is performance critical (image views are taken into account each time you manipulate a pixel)

Ok, I know some ways to make the image stay in the right position, I could add them too (but only if you like the idea)

ShaharMS commented 1 year ago

Another thing, I think the approach of having more view stats (such as rounded) is probably preferred, since it makes the most sense with the current way of calculating views & probably includes the least overhead.

Wither362 commented 1 year ago

Another thing, I think the approach of having more view stats (such as rounded) is probably preferred, since it makes the most sense with the current way of calculating views & probably includes the least overhead.

Yeah, you’re right, but I can’t find a way to calculate a rounded rectangle, I asked my friends, and they told me this:

Wither362 commented 1 year ago

@ShaharMS, I have a question, how do I use these functions for this code to work:?

MathTools.radiansFromPointToPoint2D(start, end);
MathTools.radiansToSlope(radians);
MathTools.radiansToDegrees(radians);

I’ve seen them in Line2D.hx, and it may help with this

ShaharMS commented 1 year ago

The first function returns the angle between two points in radians, the second and third functions convert between different notations of angles - degrees, slopes and radians. You could see how I use these functions in other files

Wither362 commented 1 year ago

Squircle? https://en.m.wikipedia.org/wiki/Squircle