Skip to main content

Crate otf_pixels_codec_tiff

Crate otf_pixels_codec_tiff 

Source
Expand description

TIFF codec for otf-pixels, implemented from scratch.

Baseline TIFF 6.0: both byte orders, strip and tile layouts, none/LZW/ Deflate/PackBits compression, greyscale/RGB/palette photometrics at 1, 8 and 16 bits. Exotic tags are skipped rather than treated as errors, which SPEC §Formats requires and TIFF’s extensibility makes essential.

§Why TIFF is the streaming showcase

A tiled TIFF stores its pixels as an array of independently compressed rectangles, each with its own offset. That makes it the one v1 format capable of genuine random access: producing an arbitrary region means decompressing the tiles it touches and nothing else.

So TiffDecoder reports DecodeCapability::Regions for a tiled file, and the scheduler pulls regions rather than rows. Turning a 2 GB tiled scan into a thumbnail then costs the tiles the thumbnail actually needs — which is what ADR-0001’s demand-driven design was for, and what the rest of v1 has been building toward.

Modules§

tag
The baseline tags this codec understands (TIFF 6.0 §Section 8).

Structs§

Directory
A parsed image file directory.
TiffCodec
The TIFF entry in a sniffing registry.
TiffDecoder
Decodes a TIFF stream.
TiffEncoder
Encodes a baseline TIFF.
TiffImage
Everything about a TIFF image that decoding needs.

Enums§

ByteOrder
Byte order, from the two-character header.
Compression
How pixel data is compressed (TIFF 6.0 §Section 8, plus §Deflate).
Layout
Whether the pixels are stored in strips or tiles.
Photometric
How samples are interpreted.
TiffLayout
How an encoder arranges pixels in the file.

Functions§

probe
Whether prefix starts with a TIFF header.