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

displayio.Bitmap: Allow modification though the buffer protocol #4549

Merged
merged 1 commit into from
Apr 5, 2021

Conversation

jepler
Copy link
Member

@jepler jepler commented Apr 3, 2021

It is required to call .dirty() with appropriate arguments after modifications through the buffer protocol, or the display might not be updated correctly.

I've played with this a bit locally with #4547 with an adapted FFT waterfall and it is the fastest method I found to update bitmap content. However, both this and arrayblit were about 10x faster than repeated assignment to bitmap elements, and the remaining difference was small. (12ms vs 1.2ms or 0.5ms for the bitmap update & redraw step only; "row time" includes 16ms to record sound and 8ms to process the FFT)

It is required to call .dirty() with appropriate arguments after modifications through the buffer protocol, or the display might not be updated correctly.
@jepler
Copy link
Member Author

jepler commented Apr 3, 2021

Code for the modified FFT waterfall at https://gist.github.com/d211665a27a55961df782b70eb13e01f

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Thank you!

@tannewt tannewt merged commit e962b24 into adafruit:main Apr 5, 2021
@jepler jepler deleted the writable-bitmaps branch November 3, 2021 21:11
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.

None yet

2 participants