I hope I got this right, but if I create a bytes object in a precompiled pym file, data from this object is read directly from flash and not allocated in RAM.
So in file fontengine.py:
Code: Select all
_font_data = b'\xff\x00..........'
In order to transfer e.g. a single letter into the target frame buffer, I tried to wrap this memory segment in a FrameBuffer:
Code: Select all
fba = framebuf.FrameBuffer(_font_data, 8, 8, framebuf.MONO_VLSB)
Code: Select all
fba = framebuf.FrameBuffer(bytearray(_font_data), 8, 8, framebuf.MONO_VLSB)
- Is this actually the most efficient way to render letters using the built-in framebuf module?
- Shouldn't bytes implement the buffer protocol?
- Is this an implementation problem of the framebuf module?
I think, reimplementing the bit mapping functions to transfer the pixels into the target frame buffer seems not the right way to go, because I only recreate slower versions of already existing functions.