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

fn BitDepth::pxstride: Make generic over stride type and BitDepth #769

Merged
merged 2 commits into from
Feb 28, 2024

Conversation

kkysen
Copy link
Collaborator

@kkysen kkysen commented Feb 28, 2024

This way we don't have to do BD::pxstride(stride as usize) as isize, which is verbose and wrong for negative strides. There may still be some places where strides are always positive, though, so it's kept generic. This also lets us fix part of #636 gradually; this is the first major step in fixing part of #636. We'll fully fix that later.

@fbossen, hopefully this'll help you in your PRs not have to write the hundreds of extra as usize) as isize casts.

…x. `isize` or `usize`.

This way we don't have to do `BD::pxstride(stride as usize) as isize`,
which is verbose and wrong for negative strides.
There may still be some places where strides are always positive, though, so it's kept generic.
This also lets us fix #636 gradually; this is the first major step in fixing #636.
@fbossen
Copy link
Collaborator

fbossen commented Feb 28, 2024

@fbossen, hopefully this'll help you in your PRs not have to write the hundreds of extra as usize) as isize casts.

Indeed, this should help. I will clean up the casts after this is merged.

@kkysen kkysen merged commit 4a861d5 into main Feb 28, 2024
34 checks passed
@kkysen kkysen deleted the kkysen/fn-pxstride-generic-impl branch February 28, 2024 21:04
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.

3 participants