otf-pixels-core
The engine under Pixels: graph, tiles, scheduler
An Open Tech Foundation project
An image is a node in an immutable, lazy graph. The scheduler pulls output tiles through it on demand, on one shared pool of worker threads.
[!TIP] Building an app or a server? Use
otf-pixelsinstead: it wraps this engine in a chainable API with every codec and op wired in.
Use it
Depend on this crate to write a codec or an op. A codec implements Decoder
(rows out) and Encoder (rows in):
use ;
/// A decoder for a flat grey image.
;
let grey = Grey;
let png = from_decoder
.output
.bytes?;
API
| Item | Purpose |
|---|---|
Image, Node |
The lazy graph: apply an op, combine several inputs |
Decoder, Encoder, Codec |
The codec contracts: rows out, rows in, magic-byte probe |
Op, Producer, AccessPattern |
The op contract: output shape, input demand, per-tile compute |
Scheduler, SchedulerOptions |
Tile evaluation; Scheduler::global() is the shared default |
ImageDescriptor, PixelFormat, Region |
Shape, pixel layout and rectangles |
Tile, TileBuf, TileMut |
The pixel buffers ops read and write |
Source, Sink |
Streaming input and output; any Read / Write qualifies |
Limits, PixelsError, ErrorCode |
Input limits and the error taxonomy |
evaluate |
The whole-image reference evaluator the scheduler is tested against |
Part of Pixels
| Crate | Role |
|---|---|
otf-pixels |
The chainable Image API most users want |
otf-pixels-core |
Graph, tiles, scheduler, codec and op traits |
otf-pixels-ops |
Image operations |
otf-pixels-compress |
DEFLATE, zlib, LZW, checksums |
otf-pixels-codec-* |
One crate per format |
License
Apache-2.0 — see LICENSE.