Skip to content

image() slow if auto_write on #78

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

Closed
caternuson opened this issue Jul 10, 2020 · 1 comment
Closed

image() slow if auto_write on #78

caternuson opened this issue Jul 10, 2020 · 1 comment

Comments

@caternuson
Copy link
Contributor

The image() function does a loop and sets the display pixel by pixel:

for x in range(self.columns): # yes this double loop is slow,
for y in range(self.rows): # but these displays are small!
self.pixel(x, y, pixels[(x, y)])

If auto_write is on, this will cause the entire display to be updated with each pixel set:
if self._auto_write:
self.show()

This leads to a noticeably slow update.

Could maybe force auto_write off before looping and then back to whatever it was after the loop.

@makermelissa
Copy link
Collaborator

That's how I would do it. :) Don't forget to apply the same thing in the Matrix8x8x2 class's image() function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants