Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fast copy from ulab to displayio.Bitmap #4414

Closed
@dglaude

Description

@dglaude

Playing with ulab, I found it was costly to copy from an array to a display.bitmap.

ulab can build a buffer: ulab.array.tobytes

Here is the current fastest way I was able to copy:

image_bitmap = displayio.Bitmap(24, 32, number_of_colors)
inta=ulab.array((npframe-min_t)*factor,dtype=ulab.int8)
index = 0
for h in range(24):
    for w in range(32):
        image_bitmap[h, w] = inta[index] 
        index+=1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions