Commit Graph

29 Commits

Author SHA1 Message Date
Jeff Epler
c6dbc7df3a
Add displayio bitmaps to unix build 2021-11-12 10:47:17 -06:00
Jeff Epler
78089107bc displayio.Bitmap: Allow modification though the buffer protocol
It is required to call .dirty() with appropriate arguments after modifications through the buffer protocol, or the display might not be updated correctly.
2021-04-03 10:41:20 -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
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
c157ada90c displayio.Bitmap: Make memoryview()able 2021-03-17 16:26:45 -05:00
microDev
a52eb88031
run code formatting script 2021-03-15 19:27:36 +05:30
Kevin Matocha
0c012da080 refactor displayio set_pixel for use in bitmap_tools 2021-03-07 11:22:30 -06:00
Kevin Matocha
3afc269b18 fix two off by one errors 2021-02-26 17:22:11 -06:00
Kevin Matocha
4097c949a3 Update for clean blitting into itself 2021-02-25 14:16:40 -06:00
Kevin Matocha
a9f6d147c4 Merge adafruit/main latest 2020-08-21 14:37:32 -05:00
Kevin Matocha
7e529ed4c5 Merge with latest adafruit/main 2020-08-21 14:28:24 -05:00
Kevin Matocha
fc1347ac2a deleted whitespace 2020-08-14 13:37:06 -05:00
Kevin Matocha
ba5dedc1df deleted whitespace 2020-08-14 13:37:06 -05:00
Kevin Matocha
b1fce9e933 Deleted trailing whitespace 2020-08-14 13:36:59 -05:00
Kevin Matocha
a66ef32da2 Added inclusive indexing for x2,y2, fixed default value handling for x1,y1, added bitmap palette comparison 2020-08-14 13:15:01 -05:00
Margaret Matocha
824f47d6e9 Added bitmap.blit function for bitmap slice copy 2020-08-14 12:59:57 -05:00
Margaret Matocha
4ba9ff892c Added bitmap.blit function for copying slices of bitmaps 2020-08-14 12:59:48 -05:00
Margaret Matocha
b6008d0032 Adding bitmap.insert to copy a slice of a source bitmap into another bitmap 2020-08-07 15:59:42 -05:00
Margaret Matocha
64c9baa6aa Added bitmap.insert function for slice copy into a bitmap from another bitmap 2020-08-07 15:46:00 -05:00
caternuson
a9fb34eb93 make packed word and copy it in 2020-04-13 16:48:27 -07:00
caternuson
dc75746842 add docstring, clean up 2020-04-09 08:59:26 -07:00
caternuson
49fff2d9b4 initial working fill 2020-04-09 08:43:50 -07:00
Scott Shawcroft
4a6bdb6fe4
Track a dirty area for in-memory bitmaps
This fixes the bug that bitmap changes do not cause screen updates
and optimizes the refresh when the bitmap is simply shown on the
screen. If the bitmap is used in tiles, then changing it will
cause all TileGrids using it to do a full refresh.

Fixes #1981
2019-07-18 16:47:28 -07:00
Scott Shawcroft
6fcda1dec4
Support multi-byte values with Bitmap
It also corrects the behavior of single byte values.

Fixes #1744
2019-04-04 12:50:35 -07:00
Scott Shawcroft
c17f147be9
A variety of displayio improvements
This changes a number of things in displayio:
* Introduces BuiltinFont and Glyph so the built in font can be used by libraries. For boards with
  a font it is available as board.TERMINAL_FONT. Fixes #1172
* Remove _load_row from Bitmap in favor of bitmap[] access. Index can be x/y tuple or overall index. Fixes #1191
* Add width and height properties to Bitmap.
* Add insert and [] access to Group. Fixes #1518
* Add index param to pop on Group.
* Terminal no longer takes unicode character info. It takes a BuiltinFont instead.
* Fix Terminal's handling of [###D vt100 commands used when up arrowing into repl history.
* Add x and y positions to Group plus scale as well.
* Add bitmap accessor for BuiltinFont
2019-02-11 20:55:05 -08:00
Scott Shawcroft
1683eb913d
Minor tweaks based on feedback 2018-09-06 14:49:49 -07:00
Scott Shawcroft
121903b6ee
Tweaks based on feedback 2018-08-31 14:21:48 -07:00
Scott Shawcroft
6697544cdf
Introduce displayio to render graphics to displays.
It's designed to minimize RAM footprint by using Sprites to
represent objects on the screen. The object model also facilitates
partial screen updating which reduces the bandwidth needed to display.

This is all handled in C. Python simply manipulates the objects with
the ability to synchronize to frame timing.
2018-08-31 12:31:52 -07:00