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

Speedup image comparision slider during WipeEffect #33

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Edi61
Copy link

@Edi61 Edi61 commented Apr 9, 2024

As also marked in
WinMerge/winmerge#1596
the slider is very slow.

Here maybe one solution:

  • WipeEffect only if position changed (no refreshimage on everywipe -> not sensefull, since during wiping with the mouse
    in any case you are not be able to change any parameters which could lead to an image change)
  • Difference based wipeeffect (Only part between old and new position is updated)

Principially it works very fine and smooth, but if the image is changed before wiping with e.g. adjust offset,
the draw events are lost/not perfmored, maybe you have an idea why?

Regards,

- WipeEffect only if position changed
- Difference based wipeeffect (Only part between old and new position is updated)
@sdottaka
Copy link
Member

sdottaka commented Apr 9, 2024

Thank you for PR. However, it does not seem to work well as shown in the attached GIF animation.

Principially it works very fine and smooth, but if the image is changed before wiping with e.g. adjust offset, the draw events are lost/not perfmored, maybe you have an idea why?

I don't know so far.

winimergePR#33

@Edi61
Copy link
Author

Edi61 commented Apr 10, 2024

Aah, I have only checked with heic files, did not jet tessted with other image formats.
Then its probably related to something which is special for heic files.
I'll recheck it.

@Edi61
Copy link
Author

Edi61 commented Apr 14, 2024

I have found the problem, it's generally not the image format,
but any transperancy in the image which leads to not working wiping.
It also explains why adjusting/moving image is also not working,
because here we get also some transperancy parts.
Don't know jet how to solve...

@sdottaka
Copy link
Member

That certainly seems like it. As of now, I don't know why either.

@Edi61
Copy link
Author

Edi61 commented Apr 17, 2024

I have found the root cause.

It's the function call FreeImage_Composite inside fipWinImage::drawEx:
https://github.com/WinMerge/freeimage/blob/78364ed94b4cb2d830805a26cb65bf5e6f523d58/Wrapper/FreeImagePlus/src/fipWinImage.cpp#L407
in case of the image transparent:
https://github.com/WinMerge/freeimage/blob/78364ed94b4cb2d830805a26cb65bf5e6f523d58/Wrapper/FreeImagePlus/src/fipWinImage.cpp#L399

Problem is that a copy of a new display including transparency is created and this copy
is not updated anymore. Even if it would be updated it would slow down the wipe effect due to recreation of the transparency each time :-(.

Transparency detection and triggering of a redraw in case of image wiping
@Edi61
Copy link
Author

Edi61 commented Apr 20, 2024

I have found one solution, maybe not the best, but seems principially working.
If there is transparency speed up is a little lower.

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