This is required for MicroPython error text compression which is
going to be enabled by default for RP2 builds.
We have a lot of error messages, so the potential flash gain here
is worth the effort of making this work.
* Store a reference to transform, so `set_transform(Transform())` is not GC'd until it is replaced
* Transformations return the transform, allowing chaining: `transform.rotate().scale().translate()`
* A new `get_transform` method for getting the currently set transform.
Remove the finalizer from PNGDEC and JPEGDEC, since it was both redundant
and actively harmful.
The finalizer was just calling "close" which is unecessary since the file
is closed automatically after opening/rendering and not left open.
If a file did not exist and "open_file" bailed with ENOENT then it would
be left in an unknown state, and the finalizer calling "close" would
cause a hardlock.
Somewhere in the conversion from C++ to C we lost support for 16-bit point counts.
Raise the internal point count to 16-bit, and check for a flag in the font.
If the flag is set, treat the point count as 16-bits, otherwise fallback to 8 for back compatibility.
list(Polygon) should return a list of points, but crashed with non-empty polygons.
We were advancing to the next path and then retriving an invalid point count for building the tuple.
Save the point count before advancing to the next path.
Inline and simplify the pixel flip for a 13.2ms -> 3.8ms speedup at 128x128 on RP2350 stock.
Drop RGB565 mode.
Add the ability to stack some panels, eg: 2x128x64 in a 128x127 configuration.
Since we're not using tracked allocation, any memory we don't explicitly
hold a reference to will be assumed unused by MicroPython's GC.
Pass up the pp_nodes and pp_node_counts points (hackily) to fix this.
For both APA102 and WS2812 the pins used on the same PIO must be in the same range.
The GPIO base offset applies to the whole PIO and not individual state machines.
This means that for APA102 both data and clock must be in the same pin range,
ie: either 16-48 inclusive or 0-31 inclusive.