Skip to content

Extract out hue rotate logic - #2872

Open
RunDevelopment wants to merge 4 commits into
image-rs:mainfrom
RunDevelopment:extract-huerotate
Open

RunDevelopment wants to merge 4 commits into
image-rs:mainfrom
RunDevelopment:extract-huerotate

Conversation

@RunDevelopment

@RunDevelopment RunDevelopment commented Mar 17, 2026 •

Copy link
Copy Markdown
Member

Changes:

  • Extract shared hue rotation logic into new HueRotation type.
  • Switch from f64 to f32 for better performance. Edit: Undid that.

@mstoeckl mstoeckl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this refactoring reduces lines of code, I expect it may make hue rotation a bit slower because HueRotation::apply doesn't inline. I think this change is safe to skip; others may prefer less code size; I don't have a strong opinion either way.

@RunDevelopment

Copy link
Copy Markdown
Member Author

Pretty sure apply was already inlined (because LLVM really likes to inline), but I slapped on #[inline] just in case.

This branch has not been deployed

No deployments
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