Skip to main content

Module bands

Module bands 

Source
Expand description

The PNG, written band by band: each band as many rows as fit in BAND_BYTES of pixels, its rows streamed into the png crate’s encoder as it is had, so what is held at once is one band — whatever paints or caches its pieces, and however wide the drawing is.

Enums§

Band
Why writing a PNG from bands stopped: the encoder or its writer failed, or a piece couldn’t be had.
Piece
A piece of a band, TILE pixels wide at column col: a whole tile, at tile row row, or a strip rows tall starting at pixel row y — what a band of a drawing too wide for a row of tiles is made of. Either is its straight RGBA pixels, TILE wide, row after row.

Constants§

BAND_BYTES
The most pixel bytes a band holds: a band is as many rows as fit, at least one. A drawing up to 16,384 pixels wide fits a whole row of tiles.

Functions§

bands
A width × height PNG written to out band by band, each band’s pieces from piece — whole tiles while a row of them fits in BAND_BYTES, shorter strips otherwise — its rows streamed to the encoder as each band is had, so what is held at once is one band.
png
The drawing at 1× as a PNG written to out, band by band.
rows_per_band
How many rows a band of a drawing width pixels wide holds: as many as fit in BAND_BYTES, its pieces padded to whole tiles, at least one and at most a tile’s.