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

Animate overlay artists through blitting #1631

Merged
merged 1 commit into from
Dec 2, 2023
Merged

Animate overlay artists through blitting #1631

merged 1 commit into from
Dec 2, 2023

Conversation

psavery
Copy link
Collaborator

@psavery psavery commented Dec 1, 2023

This adds a blit manager to manage overlay artists

The blit manager was modified from this example: https://matplotlib.org/stable/users/explain/animations/blitting.html

It is being used to automatically manage things like updating the background image, updating the blit artists, etc.

We are now using it to manage the overlay artists, including drawing them and removing them.

Blitting the overlay artists provides a significant performance boost when we modify parameters that only require the overlay artists to be redrawn. Especially when we have a high resolution in any of the views (other than raw, which doesn't have a resolution).

For example, the sliders for the Laue parameters are significantly more interactive now. And this provides a great opportunity for us to boost performance for the pressure sliders too.

Copy link
Collaborator

@bnmajor bnmajor left a comment

Choose a reason for hiding this comment

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

This is fantastic!!

The blit manager was modified from this example: https://matplotlib.org/stable/users/explain/animations/blitting.html

It is being used to automatically manage things like updating the background
image, updating the blit artists, etc.

We are now using it to manage the overlay artists, including drawing them
and removing them.

Blitting the overlay artists provides a *significant* performance boost when
we modify parameters that only require the overlay artists to be redrawn.
Especially when we have a high resolution in any of the views (other than raw,
which doesn't have a resolution).

For example, the sliders for the Laue parameters are significantly more
interactive now. And this provides a great opportunity for us to boost
performance for the pressure sliders too.

Signed-off-by: Patrick Avery <[email protected]>
@psavery psavery merged commit 2947b95 into master Dec 2, 2023
9 checks passed
@psavery psavery deleted the blit-overlays branch December 2, 2023 12:28
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