otf-pixels-codec-raw
Raw pixels for Pixels
An Open Tech Foundation project
Uncompressed pixels with no header: the caller states width, height, pixel format and stride. A short input is an error, never a panic.
[!TIP] Building an app or a server? Use
otf-pixelsinstead: it picks this codec from the file's bytes with itsrawfeature.
Use it
Transcode row by row, without holding the frame:
use ;
use ;
use RawFormat;
use ;
let layout = packed;
let mut decoder = new?;
let descriptor = decoder.descriptor;
let mut encoder = new;
let mut out = Vecnew;
encoder.write_header?;
let mut row = vec!;
for _ in 0..descriptor.height
encoder.finish?;
Capabilities
| Area | Support |
|---|---|
| Decode | Any PixelFormat, packed or with a row stride |
| Encode | Packed rows |
API
| Item | What it does |
|---|---|
RawFormat |
The layout: packed, with_stride, from_dimensions |
RawDecoder, RawEncoder |
Decoder and encoder |
RawCodec |
Registry entry (raw has no magic bytes) |
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.