I suspect this is all above my pay grade
Perhaps it's worth my explaining what I was hoping to achieve. My font-to-py
repo includes Writer
classes; these render fonts to a framebuf
or to a display driver subclassed from Framebuf
is for the case where the destination framebuf
is monochrome and uses .blit
: it is therefore fast. CWriter
has to render pixel by pixel in Python: this is because .blit
does not behave in a reasonable way when the source framebuf
is monochrome and the destination is color.
This has been discussed on GitHub without discernible progress. A fully generic solution of blitting between arbitrary color spaces is difficult and certainly beyond me. I offered to produce a PR for a partial solution where the source is mono but this was not taken up.
I therefore wanted to write a loadable module which exported a function with this call signature:
Code: Select all
blit(source, dest, fgcolor, bgcolor)
I don't want users to have to compile MicroPython but providing an option to create a loadable module - and offering pre-built ones for popular archs - would be worthwhile.
These are the implied questions:
- Is this fundamentally achievable?
- If so is it achievable by me?
- If so, how would I go about it?
I think I know sufficient C to write it, but I'll probably need help on the MicroPython interface and I'm rusty on the gory details of linking...