Skip to content

How to pass floating types, such as VecPoint2f, to functions? #351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
redcurry opened this issue Apr 24, 2025 · 5 comments
Open

How to pass floating types, such as VecPoint2f, to functions? #351

redcurry opened this issue Apr 24, 2025 · 5 comments
Labels
question Further information is requested

Comments

@redcurry
Copy link

Functions such as arcLength take a VecPoint, but there isn't an equivalent arcLength2f that take a VecPoint2f. What's the best way to handle this? I could convert VecPoint2f to VecPoint, but I lose some precision doing that.

@redcurry redcurry added the question Further information is requested label Apr 24, 2025
@rainyl
Copy link
Owner

rainyl commented Apr 24, 2025

@redcurry Unfortunately this is not supported now, to support it we have to add a new C API and it's dart wrapper.

Is the precision important for your application? If so, I can add it when having some time.

@redcurry
Copy link
Author

No, it's not really that important. Just wondering if there was a way to do it now. I'll just convert VecPoint2f to VecPoint. Thanks.

@redcurry redcurry reopened this Apr 26, 2025
@redcurry
Copy link
Author

On second thought, it can impact the accuracy of my application (since it involves measuring), so I'll reopen this issue.

@rainyl
Copy link
Owner

rainyl commented Apr 27, 2025

It's fine to leave it open, but I have no much time recently, so it's unlikely to be solved in a short time.

What functions do you need? I am considering add APIs that take Mat as input so that high precision conditions can be covered.

@redcurry
Copy link
Author

redcurry commented Apr 27, 2025

No worries, and thank you. At the moment, I need the arcLength function.

Update: I also need the boundingRect function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants