Skip to content

displayio: Add lightweight Rectangle#2843

Closed
kvc0 wants to merge 3 commits into
adafruit:masterfrom
kvc0:lightweight_shapes
Closed

displayio: Add lightweight Rectangle#2843
kvc0 wants to merge 3 commits into
adafruit:masterfrom
kvc0:lightweight_shapes

Conversation

@kvc0
Copy link
Copy Markdown

@kvc0 kvc0 commented May 2, 2020

Shape uses a bitmap to represent blocked regions. This is fine
for some shapes, but others may be more compactly represented.

This lets users make large, possibly overlapping areas of their screen be colored without running out of memory due to bitmap arrays in adafruit_display_shapes.Rect.

image

Used like:

palette = displayio.Palette(1)
palette[0] = 0x001100
bitmap_grid = displayio.TileGrid(
    displayio.Rectangle(320, 220),
    pixel_shader=palette,
    x=0,
    y=20,
)
display_group.append(bitmap_grid)

kvc0 and others added 3 commits May 2, 2020 02:21
Shape uses a bitmap to represent blocked regions.  This is fine
  for some shapes, but others may be more compactly represented.
@kvc0
Copy link
Copy Markdown
Author

kvc0 commented May 2, 2020

Investigating hallowing memory and alternate shape ideas.

@kvc0 kvc0 closed this May 2, 2020
@k0d
Copy link
Copy Markdown

k0d commented May 2, 2020

The error in the building isn't down to your code, it's something to do with the Korean font. I don't know much about that, but I just wanting to let you know it wasn't your code.

@kvc0
Copy link
Copy Markdown
Author

kvc0 commented May 2, 2020 via email

@tannewt
Copy link
Copy Markdown
Member

tannewt commented May 4, 2020

You could split Rectangle out into a shapes module or similar and only include it on larger boards. M0 boards are basically out of space for new features.

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