Skip to content

Use Operation.rot/2 for right-angle rotations#199

Merged
kipcole9 merged 1 commit into
elixir-image:mainfrom
hlindset:use-rot-for-right-angle-rotate
Jun 18, 2026
Merged

Use Operation.rot/2 for right-angle rotations#199
kipcole9 merged 1 commit into
elixir-image:mainfrom
hlindset:use-rot-for-right-angle-rotate

Conversation

@hlindset

Copy link
Copy Markdown
Contributor

Updated rotate/3 to use Operation.rot/2 as a fast path for rotations that are multiples of 90 when no displacement options are set. Falls back to Operation.rotate/3 otherwise.

This avoids resampling source pixels through an affine rotation when a discrete right-angle operation is possible.

Also updated the validation images for the +/- 90-degree rotation tests.

I adjusted the docs, but I'm not sure if the doc changes are in your style, or if you want it folded into the "Notes" section? If you accept this PR, feel free to change it however you like.

Use `Operation.rot/2` for rotations that are multiples of 90 when
no displacement options are set. Fall back to `Operation.rotate/3`
otherwise.
@kipcole9 kipcole9 merged commit 5ab56ae into elixir-image:main Jun 18, 2026
4 of 5 checks passed
@kipcole9

Copy link
Copy Markdown
Collaborator

@hlindset, thanks very much for the PR, gratefully accepted. I get a new version published in the next few hours.

@kipcole9

Copy link
Copy Markdown
Collaborator

I've published Imaged version 0.69.0 with the following changelog entry:

Enhancements

Thanks again for the PR.

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.

2 participants