std.png
rfc 2083 decode to RGBA8 and encode; all color types, depths, interlace, tRNS
PngError
Section titled “PngError”pub PngError :: errors { not_png, corrupt, unsupported, too_big,}not_png: no PNG signaturecorrupt: truncated chunk, bad CRC, or bad image dataunsupported: color type, depth or method not in the spectoo_big: past 2^28 pixels
pub Image :: struct { width: u32, height: u32, pixels: []u8,}width * height RGBA pixels, 4 bytes each, rows top to bottom
Image.at
Section titled “Image.at”pub at :: fn(self: *Self, x: u32, y: u32) -> u320,0 is top left; returns r | g << 8 | b << 16 | a << 24
pub image :: fn(a: *Arena, width: u32, height: u32) -> Imageall pixels transparent black; in a
decode
Section titled “decode”pub decode :: fn(a: *Arena, data: []const u8) -> Image ! PngErrorpixels in a
encode
Section titled “encode”pub encode :: fn(a: *Arena, img: Image, level: u32) -> []const u8file bytes in a; zlib level 0..9; RGB8 if all opaque, else RGBA8