Skip to content
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

Roll our own matrix code & separate math into new crate #27

Merged
merged 7 commits into from
Nov 21, 2024

Conversation

FreezyLemon
Copy link
Contributor

Closes #24.

I hope it's ok to have these (multiple) changes in one PR. The new crate is minimal but should include everything that's needed for distribution, I think.

Clippy lints for yuvxyb_math are copied from yuvxyb/src/lib.rs. CI for the subcrate is also very simple because the build & msrv are transitively confirmed via yuvxyb (-math is a non-optional dependency).

I'll run some benches soon(TM), but this PR is otherwise done in my eyes.

@shssoichiro
Copy link
Collaborator

I like the #[must_use] additions. tbh I wish the compiler automatically added these for functions with no mutable arguments and a returned value. or maybe there's a clippy lint to enforce adding it.

@shssoichiro shssoichiro merged commit d7c338f into rust-av:main Nov 21, 2024
3 checks passed
@FreezyLemon
Copy link
Contributor Author

I like the #[must_use] additions. tbh I wish the compiler automatically added these for functions with no mutable arguments and a returned value. or maybe there's a clippy lint to enforce adding it.

There actually was a clippy lint for it, funnily enough. I think it's because I moved the structs to a public API (instead of pub(crate) etc.).

One useful thing is to mark a type as must_use. That way, any public API returning it will be must_use as well.

@FreezyLemon FreezyLemon deleted the own-matrix-math branch November 21, 2024 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calculate transform matrices at compile-time
2 participants