Skip to content

ICO: Extract AND mask logic into function#3034

Open
RunDevelopment wants to merge 1 commit into
image-rs:mainfrom
RunDevelopment:ico-and-out
Open

ICO: Extract AND mask logic into function#3034
RunDevelopment wants to merge 1 commit into
image-rs:mainfrom
RunDevelopment:ico-and-out

Conversation

@RunDevelopment

Copy link
Copy Markdown
Member

Tiny bit of refactoring. I extracted the logic for reading and applying the AND mask out into its own function.

I also made 2 mindor changes:

  1. I removed the height check. rgba.len() is always w*h anyway.
  2. In the inner loop, I changed x >= width to x >= row.len(). These are equivalent, but the latter should help the compiler to optimize away bounds checks.

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.

1 participant