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

More bucket tool optimizations #19

Conversation

scribblemaniac
Copy link

There's still some room for improvement, but this will the last of them from me for now.

This change is useless for release build as the compiler will
optimize this, but for debug builds this results in a roughly 3x
speed improvment.
This treats everything outside the minimally bounded target image
as a single region (which it is). compareColor only needs to be
called once, and if it's true, then all of the transparent "border"
region can be filled at once. Ideally this would be done with a
rectangular fill with a mask when creating replaceImage, but
unforunately that information needs to be present in filledPixels
if expandFill is run. Thankfull this is pretty fast anyway.
@MrStevns MrStevns merged commit c89ebb4 into MrStevns:bucket-tool-optimizations2 Apr 13, 2022
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