dolphin icon indicating copy to clipboard operation
dolphin copied to clipboard

Support for python's Buffer protocol

Open mkzeender opened this issue 11 months ago • 2 comments

The save-stating and screenshotting methods should be able to read from and write to any python object that exposes a buffer.

Writing the data directly into a buffer will greatly increase performance, because you won't have to allocate memory for a bytes object, nor will you have to copy the data twice.

The buffer protocol was made an official protocol as of python 3.11, and all major array-like objects support it (including bytes, bytearray, array.array, numpy.array, etc).

mkzeender avatar Mar 05 '24 06:03 mkzeender