Skip to main content

Module png

Module png 

Source
Expand description

The PNG reader behind sample_pixel (docs/testing.md). A small PNG reader for the sample_pixel step (docs/testing.md): the in-process capture arrives as PNG bytes, and a test asks for the color of one point of it. It reads the formats a window capture is written in, 8- and 16-bit gray, gray-alpha, RGB and RGBA, non-interlaced, into RGBA8, with its own inflate (RFC 1951) rather than a dependency: this engine is linked into every app, and the reader is a few hundred lines.

Structs§

Png
A PNG read as far as its header: the size is known, the pixels are not decoded yet.
Rgba
A decoded image: rgba holds width * height pixels, four bytes each, row by row.

Functions§

decode
Decode bytes as a PNG.
inflate
Inflate a raw deflate stream.