Commit Graph

21 Commits

Author SHA1 Message Date
Jeff Epler a05aab8304
Merge pull request #4454 from jepler/bitmaptools-readinto-4bit
Fix reading 4-bit data
2021-03-21 19:56:23 -05:00
Jeff Epler c64fccbeee hex may be more obvious 2021-03-21 13:48:08 -05:00
Jeff Epler 7229fe631d Fix reading 4-bit data 2021-03-21 13:37:38 -05:00
Jeff Epler e084a92671
Merge pull request #4432 from jepler/bitmap-dirty-improvements
Bitmap dirty improvements
2021-03-20 13:09:59 -05:00
Kevin Matocha 9b188934d1 off by one error in rotozoom dirty_area 2021-03-19 21:23:55 -05:00
Jeff Epler 95ac6c716b rotozoom: switch to using set_dirty_area + write_pixel 2021-03-19 20:40:23 -05:00
Jeff Epler d0125617fd
Merge pull request #4428 from kmatch98/bitmap-read-2
Add `reverse_rows` to speedy bitmaptools.readinto function
2021-03-18 18:41:35 -05:00
Jeff Epler f5fd42c393 displayio: Move bitmap read-only checking to displayio_bitmap_set_dirty_area
This is a modest code savings, but more importantly it reduces
boilerplate in bitmap-modifying routines.

Callers need only ensure they call displayio_bitmap_set_dirty_area in
advance of the bitmap modifications they perform.

(note that this assumes that no bitmap operation can enter background
tasks. If an operation COULD enter background tasks, it MUST re-dirty
the area it touches when it exits, simply by a fresh call to
set_dirty_area with the same area as before)
2021-03-18 09:20:56 -05:00
Jeff Epler 36d608aa67 displayio_bitmap_set_dirty_area: rewrite in terms of displayio_area
.. simplifying code in the process.  For instance, now fill_region
uses area routines to order and constrain its coordinates.

Happily, this change also frees a modest amount of code space.
2021-03-18 09:20:56 -05:00
Jeff Epler 47ca792765 arrayblit: mark bitmap area as dirty 2021-03-17 20:25:22 -05:00
Kevin Matocha c37a1f45f3 ran pre-commit for formatting fixes 2021-03-17 11:00:32 -05:00
Kevin Matocha 580121d46e minor formatting 2021-03-17 09:38:53 -05:00
Kevin Matocha ef91e1752c merge upstream/main 2021-03-17 09:30:51 -05:00
Jeff Epler 97b6664201 re-format with uncrustify 2021-03-16 12:20:09 -05:00
Kevin Matocha 227ac67463 Add reverse_rows option to bitmaptools.readinto 2021-03-16 10:01:12 -05:00
Jeff Epler 542fb58673 add arrayblit 2021-03-15 20:36:44 -05:00
Jeff Epler 094265cb86 bitmaptools.readinto: Fix diagnostics on atmel-samd builds 2021-03-14 15:36:20 -05:00
Jeff Epler 9133b23a37 bitmaptools: Add readinto
When reading uncompressed bitmap data directly, readinto can work
much more quickly than a Python-coded loop.

On a Raspberry Pi Pico, I benchmarked a modified version of
adafruit_bitmap_font's pcf reader which uses readinto instead of
the existing code. My test font was a 72-point file created from Arial.

This decreased the time to load all the ASCII glyphs from 4.9 seconds to
just 0.44 seconds.

While this attempts to support many pixel configurations (1/2/4/8/16/24/32
bpp; swapped words and pixels) only the single combination used by
PCF fonts was tested.
2021-03-14 13:57:46 -05:00
Kevin Matocha a9afa0d9d4 Move input checks to shared-module, update docstrings 2021-03-11 16:18:17 -06:00
Kevin Matocha 85f0f07d51 add fill_region and draw_line to bitmaptools 2021-03-10 11:37:27 -06:00
Kevin Matocha b720028642 Add bitmaptools module 2021-02-23 23:23:14 -06:00