Skip to content

Add option for using bitmaptools.readinto for indexed bitmap loads #45

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

Merged
merged 4 commits into from
Mar 19, 2021

Conversation

kmatch98
Copy link
Contributor

@kmatch98 kmatch98 commented Mar 16, 2021

This adds an option to use the new bitmaptools.readinto function. I observed a 4x speedup when loading a 320x240 pixel bitmap.

Since some graphics bitmap files are read in different row directions, this library update requires one addition to the bitmaptools.readinto function to add reverse_rows, from this PR: adafruit/circuitpython#4428

Also, see this comment from @jepler that mentions the row direction of BMP files: adafruit/circuitpython#4403 (comment)

@kmatch98
Copy link
Contributor Author

It looks like a lot of pylint errors are coming up, even on the existing repository. I see a recent PR from @dherrada to add pylint checks, which may have highlighted these issues.

I'm not sure if that should be combined in this PR or with a separate PR to clean those up. Let me know if you want me to issue a separate PR with the cleanups.

@tannewt tannewt requested a review from jepler March 16, 2021 17:43
@evaherrada
Copy link
Collaborator

@kmatch98 Thanks for pinging me on this. So some of this is expected, specifically the duplicate-code check (at the bottom of the pylint section).

However, it seems like the tests directory is being linted which wasn't previously happening. I personally don't see any downside to linting the tests directory and I don't think it'll take too long to manually do, but I think it'd be worth seeing if there are any downsides I'm not considering. @tannewt thoughts?

@evaherrada
Copy link
Collaborator

@kmatch98 Yeah, they should be linted. I'll take care of it and then you can just merge master into your branch.

@kmatch98
Copy link
Contributor Author

@dherrada thanks for fixing the pylint issues. This is all passing the checks now and it's ready for review.

Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

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

I tested this successfully with:

Adafruit CircuitPython 6.2.0-beta.4-27-gc0ec904c7 on 2021-03-19; Adafruit Feather RP2040 with rp2040

Using IconWidget with on_disk set to False

It appears to be working correctly to me and I do see increased speed in the loading time for the images.

Thanks for this improvement @kmatch98 and @jepler

Copy link
Contributor

@jepler jepler left a comment

Choose a reason for hiding this comment

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

Thanks @kmatch98 for writing and @FoamyGuy for testing, y'all rock

@jepler jepler merged commit a73fe3b into adafruit:master Mar 19, 2021
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Mar 20, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI to 3.5.7 from 3.5.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_ESP32SPI#128 from adafruit/anecdata-patch-2
  > Merge pull request adafruit/Adafruit_CircuitPython_ESP32SPI#126 from adafruit/anecdata-patch-1

Updating https://github.com/adafruit/Adafruit_CircuitPython_LTR390 to 1.1.0 from 1.0.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_LTR390#3 from CedarGroveStudios/main

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bitmap_Font to 1.3.7 from 1.3.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_Bitmap_Font#41 from jepler/use-bitmaptools-readinto

Updating https://github.com/adafruit/Adafruit_CircuitPython_datetime to 1.1.2 from 1.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_datetime#7 from brentru/fix-failing-tests
  > Merge pull request adafruit/Adafruit_CircuitPython_datetime#6 from cognitivegears/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_ImageLoad to 0.14.0 from 0.13.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_ImageLoad#45 from kmatch98/master
  > "Increase duplicate code check threshold "
  > Merge pull request adafruit/Adafruit_CircuitPython_ImageLoad#46 from adafruit/tests-linting

Updating https://github.com/adafruit/Adafruit_CircuitPython_Logging to 1.2.8 from 1.2.7:
  > Merge pull request adafruit/Adafruit_CircuitPython_Logging#18 from dastels/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_Motor to 3.3.0 from 3.2.8:
  > Merge pull request adafruit/Adafruit_CircuitPython_Motor#54 from CedarGroveStudios/master
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.

4 participants