plot::png
PNG encoding (ISO/IEC 15948): 8-bit RGB, or RGBA when any pixel is not opaque, each row filtered by the type with the smallest sum of absolute values (the usual heuristic), compressed by the package's own DEFLATE.
Functions
encodeSource
pub fn encode(rgba: List<u8>, width: usize, height: usize) -> List<u8> A PNG file of width x height pixels from RGBA bytes, top row
first.
nabi
let px: List<u8> = [255, 0, 0, 255, 0, 0, 255, 128];
let f = plot::png::encode(px, 2, 1);
assert(f[0] == 137 && f[1] == 80 && f[2] == 78 && f[3] == 71);
crc32Source
pub fn crc32(data: List<u8>) -> u32 CRC-32 (ISO 3309, as PNG and zlib use) of data.
nabi
assert(plot::png::crc32("IEND".as_bytes().to_list()) == 0xae426082);