circuitpython/examples
Damien George b15348415e extmod/modframebuf: Add support for blit'ing read-only data.
Currently the `FrameBuffer.blit(buf, x, y)` method requires the `buf`
argument to be another `FrameBuffer`, which is quite restrictive because it
doesn't allow blit'ing read-only memory/data.

This commit extends `blit()` to allow the `buf` argument to be a tuple or
list of the form:

    (buffer, width, height, format[, stride])

where `buffer` can be anything with the buffer protocol and may be
read-only, eg `bytes`.

Also, the palette argument to `blit()` may be of the same form.

The form of this tuple/list was chosen to be the same as the signature of
the `FrameBuffer` constructor (that saves quite a bit of code size doing it
that way).

Signed-off-by: Damien George <damien@micropython.org>
2025-06-04 02:40:45 +10:00
..
bluetooth examples/bluetooth: Link to aioble in BLE examples. 2023-09-01 14:05:32 +10:00
embedding embed: Improve stack top estimation. 2024-02-15 10:07:32 +11:00
hwapi all: Fix various spelling mistakes found by codespell 2.2.6. 2023-10-03 11:24:50 +11:00
natmod extmod/modframebuf: Add support for blit'ing read-only data. 2025-06-04 02:40:45 +10:00
network examples/network: Support full URLs in HTTP(S) client examples. 2024-08-28 12:28:58 +10:00
rp2 examples: Mark asm, pio, etc. as noqa: F821 (undefined-name). 2023-08-16 16:12:33 +10:00
SDdatalogger top: Update Python formatting to black "2023 stable style". 2023-02-02 12:51:03 +11:00
unix examples/unix/machine_bios.py: Fix typo. 2023-09-29 17:02:15 +10:00
usb examples/usb: Add README that points out the alternative usb modules. 2024-05-15 15:20:40 +10:00
usercmodule all: Upgrade codespell to v2.4.1. 2025-02-25 16:11:33 +11:00
accel_i2c.py all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
accellog.py all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
asmled.py examples: Mark asm, pio, etc. as noqa: F821 (undefined-name). 2023-08-16 16:12:33 +10:00
asmsum.py examples: Mark asm, pio, etc. as noqa: F821 (undefined-name). 2023-08-16 16:12:33 +10:00
conwaylife.py top: Update Python formatting to black "2023 stable style". 2023-02-02 12:51:03 +11:00
ledangle.py all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
mandel.py all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
micropython.py all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
pyb.py all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
switch.py all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00