lib-image · crate
kinogaki-png
PNG images (ISO/IEC 15948, W3C PNG Third Edition) over kinogaki_deflate.
- Repository
- lib-image (kinogaki/lib-image)
- Folder
libs/lib-image/crates/png- Source
- 4 files, 932 lines
- Tests
- 1 file, 195 lines
What it is
PNG images (ISO/IEC 15948, W3C PNG Third Edition) over kinogaki_deflate.
Images are owned and interleaved (Image, shared by every lib-image format): grey, grey and alpha, RGB or RGBA, 8 or 16 bits per sample, straight alpha. decode reads every standard PNG — greyscale, truecolor, indexed, with or without alpha, 1 to 16 bits per sample, interlaced or not, tRNS transparency — keeping the file's channels and sample size; Png reads its chunks first, so a caller knows what decoding takes before it decodes, and decodes until a stop flag is raised; encode writes any Image with a per-row adaptive filter, encode_tagged saying which display its code values are for, display_tag reading that back; decoding ignores color management chunks (samples are taken as sRGB). Chunk CRCs and the zlib checksum are verified.
Depends on
| Crate | Repository | As | What it is |
|---|---|---|---|
kinogaki-deflate | lib-image | normal | DEFLATE (RFC 1951) and zlib (RFC 1950) compression and decompression, with the CRC-32 and Adler-32 checksums the formats around them use. |
kinogaki-image | lib-image | normal | The owned image every lib-image format decodes to and encodes from. |
Third-party
None.
Used by
| Crate | Repository | As | What it is |
|---|---|---|---|
kinogaki-capture-diff | Core and the app | normal | Compares two sets of UI reference captures (tools/ui_captures.py compare BEFORE AFTER). |
kinogaki-comp | Comp | tests | Comp as an SDK package (kinogaki.comp): what fills Studio's Comp context (kinogaki.core.comp, core declares it, inside a Render Output object). |
kinogaki-harness | Core and the app | normal | Studio's test harness: the real editor, its event routing and its background work, driven offscreen with only the packages a test names. |
kinogaki-jpeg-format | JPEG | tests | JPEG, a format plugin: a JPEG reads as one standard Image as the file holds it, and an Image writes as one baseline JPEG. |
kinogaki-layout | Layout | tests | The Layout context: a page on the 2D canvas and the pieces arranged on it, images and text, back to front in the order their nodes run. |
kinogaki-png-format | PNG | normal | PNG, a format plugin: a PNG reads as one standard Image as the file holds it, and an Image writes as one PNG. |
kinogaki-spectre | Spectre | tests | Spectre, the spectral path tracer, as a Kinogaki Studio render plugin. |
kinogaki-spectre-testing | Spectre | normal | What Spectre's GPU tests share (a dev-dependency of the plugin's tests alone): the engine on an offscreen device, waits on its wakes, and images compared with a tolerance. |
kinogaki-ui-wgpu | lib-ui | normal | kinogaki-ui drawn with wgpu. |
kinogaki-workflows | Workflows | tests | Tests alone: tests/workflows drives what a person does across the plugins the app ships, through the real editor offscreen. |
Modules
decode(private)Reading PNGs: their chunks first (Png), then their pixels.531 linesencode(private)Writing 8-bit RGBA PNGs.139 linesfilter(private)Scanline filters (PNG §7.3, §9): each row is stored as its difference from a predictor over the pixel to the left (a), above (b) and above left (c),bppbytes apart.179 lines
Public types and traits
At the crate root
Structs Png
Enums DisplayTagError
Type aliases ReadTag
Re-exported from other crates
From kinogaki_deflate Level
From kinogaki_image ImageSamples
By module: 3 public types and traits in 2 modules
decode PngReadTag
encode DisplayTag
